ListAdapter


public interface ListAdapter
implements Adapter

android.widget.ListAdapter
ArrayAdapter<T> You can use this adapter to provide views for an AdapterView, Returns a view for each object in a collection of data objects you provide, and can be used with list-based user interface widgets such as ListView or Spinner
BaseAdapter Common base class of common implementation for an Adapter that can be used in both ListView (by implementing the specialized ListAdapter interface) and Spinner (by implementing the specialized SpinnerAdapter interface). 
CursorAdapter Adapter that exposes data from a Cursor to a ListView widget. 
HeaderViewListAdapter ListAdapter used when a ListView has header views. 
ResourceCursorAdapter An easy adapter that creates views defined in an XML file. 
SimpleAdapter An easy adapter to map static data to views defined in an XML file. 
SimpleCursorAdapter An easy adapter to map columns from a cursor to TextViews or ImageViews defined in an XML file. 
WrapperListAdapter List adapter that wraps another list adapter. 


Extended Adapter that is the bridge between a ListView and the data that backs the list. Frequently that data comes from a Cursor, but that is not required. The ListView can display any data provided that it is wrapped in a ListAdapter.

Summary

Inherited constants

int IGNORE_ITEM_VIEW_TYPE

An item view type that causes the AdapterView to ignore the item view.

int NO_SELECTION

Public methods

abstract boolean areAllItemsEnabled()

Indicates whether all the items in this adapter are enabled.

abstract boolean isEnabled(int position)

Returns true if the item at the specified position is not a separator.

Inherited methods

default CharSequence[] getAutofillOptions()

Gets a string representation of the adapter data that can help AutofillService autofill the view backed by the adapter.

abstract int getCount()

How many items are in the data set represented by this Adapter.

abstract Object getItem(int position)

Get the data item associated with the specified position in the data set.

abstract long getItemId(int position)

Get the row id associated with the specified position in the list.

abstract int getItemViewType(int position)

Get the type of View that will be created by getView(int, View, ViewGroup) for the specified item.

abstract View getView(int position, View convertView, ViewGroup parent)

Get a View that displays the data at the specified position in the data set.

abstract int getViewTypeCount()

Returns the number of types of Views that will be created by getView(int, View, ViewGroup).

abstract boolean hasStableIds()

Indicates whether the item ids are stable across changes to the underlying data.

abstract boolean isEmpty()
abstract void registerDataSetObserver(DataSetObserver observer)

Register an observer that is called when changes happen to the data used by this adapter.

abstract void unregisterDataSetObserver(DataSetObserver observer)

Unregister an observer that has previously been registered with this adapter via registerDataSetObserver(DataSetObserver).

Public methods

areAllItemsEnabled

Added in API level 1
public abstract boolean areAllItemsEnabled ()

Indicates whether all the items in this adapter are enabled. If the value returned by this method changes over time, there is no guarantee it will take effect. If true, it means all items are selectable and clickable (there is no separator.)

Returns
boolean True if all items are enabled, false otherwise.

See also:

isEnabled

Added in API level 1
public abstract boolean isEnabled (int position)

Returns true if the item at the specified position is not a separator. (A separator is a non-selectable, non-clickable item). The result is unspecified if position is invalid. An ArrayIndexOutOfBoundsException should be thrown in that case for fast failure.

Parameters
position int: Index of the item

Returns
boolean True if the item is not a separator