Skip to main content

Posts

Showing posts from April, 2013

Featured post

Simple RecyclerView example with filter option in Android

Hi Guys, Maybe you all are expert in terms of using RecyclerView in android. This blog is simple example for using filter option with RecyclerView adapter. As for now you will instantiate RecyclerView and set the adapter to RecyclerView as following way. RecyclerView list = (RecyclerView) findViewById(R.id.list); list.setLayoutManager(new LinearLayoutManager(this)); list.setHasFixedSize(true); ArrayList&ltNumber&gt numbers = new ArrayList&lt&gt(); String ONEs[] = {"ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN"}; String TENs[] = {"ZERO", "TEN", "TWENTY", "THIRTY", "FOURTY", "FIFTY", "SIXTY", "SEVENTY", "EIGHTY", "NINETY", "HUNDRED"}; String HUNDREDS[] = {"ZERO", "HUNDRED", "TWO HUND

ListFragments in Android with simple example

            A Fragment represents a behavior of user interface in an Activity. A activity can have more than one fragments and also a fragment can be used in more than one activities. You can use Fragment instead of Activity , TabActivity, ListActivity etc., Why Fragments?             TabActivity was deprecated in API Level 13 Because it is a subclass of ActivityGroup And ActivityGroup was deprecated because of slow performance. You can use the Fragment and FragmentManager APIs instead. When compared to activity the Fragment is much faster.             This post is an example of ListFragment in android. A Fragment that displays a list of items by binding to a data source such as an array or Cursor, and exposes event handlers when the user selects an item.             ListFragment hosts a listview object that can be bound to different data sources, typically either an array or a Cursor holding query results. The following program creates a ListFragment. ListFragment.java