Added in API level 1

SpinnerAdapter


interface SpinnerAdapter : Adapter
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).

ThemedSpinnerAdapter

An extension of SpinnerAdapter that is capable of inflating drop-down views against a different theme than normal views.

ArrayAdapter

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.

ArrayAdapter

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.

CursorAdapter

Adapter that exposes data from a Cursor to a ListView widget.

CursorAdapter

Adapter that exposes data from a Cursor to a ListView widget.

ResourceCursorAdapter

An easy adapter that creates views defined in an XML file.

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.

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.

SimpleCursorAdapter

An easy adapter to map columns from a cursor to TextViews or ImageViews defined in an XML file.

Extended Adapter that is the bridge between a android.widget.Spinner and its data. A spinner adapter allows to define two different views: one that shows the data in the spinner itself and one that shows the data in the drop down list when the spinner is pressed.

Summary

Inherited constants
Int IGNORE_ITEM_VIEW_TYPE

An item view type that causes the AdapterView to ignore the item view. For example, this can be used if the client does not want a particular view to be given for conversion in getView(int,android.view.View,android.view.ViewGroup).

Int NO_SELECTION

Public methods
abstract View!
getDropDownView(position: Int, convertView: View!, parent: ViewGroup!)

Gets a android.view.View that displays in the drop down popup the data at the specified position in the data set.

Inherited functions
Array<CharSequence!>? getAutofillOptions()

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

It should only be set (i.e., non-null if the values do not represent PII (Personally Identifiable Information - sensitive data such as email addresses, credit card numbers, passwords, etc...). For example, it's ok to return a list of month names, but not a list of usernames. A good rule of thumb is that if the adapter data comes from static resources, such data is not PII - see android.view.ViewStructure#setDataIsSensitive(boolean) for more info.

Int getCount()

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

Any! getItem(position: Int)

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

Long getItemId(position: Int)

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

Int getItemViewType(position: Int)

Get the type of View that will be created by getView for the specified item.

View! getView(position: Int, convertView: View!, parent: ViewGroup!)

Get a View that displays the data at the specified position in the data set. You can either create a View manually or inflate it from an XML layout file. When the View is inflated, the parent View (GridView, ListView...) will apply default layout parameters unless you use android.view.LayoutInflater#inflate(int, android.view.ViewGroup, boolean) to specify a root view and to prevent attachment to the root.

Int getViewTypeCount()

Returns the number of types of Views that will be created by getView. Each type represents a set of views that can be converted in getView. If the adapter always returns the same type of View for all items, this method should return 1.

This method will only be called when the adapter is set on the AdapterView.

Boolean hasStableIds()

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

Boolean isEmpty()

Unit registerDataSetObserver(observer: DataSetObserver!)

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

Unit unregisterDataSetObserver(observer: DataSetObserver!)

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

Public methods

getDropDownView

Added in API level 1
abstract fun getDropDownView(
    position: Int,
    convertView: View!,
    parent: ViewGroup!
): View!

Gets a android.view.View that displays in the drop down popup the data at the specified position in the data set.

Parameters
position Int: index of the item whose view we want.
convertView View!: the old view to reuse, if possible. Note: You should check that this view is non-null and of an appropriate type before using. If it is not possible to convert this view to display the correct data, this method can create a new view.
parent ViewGroup!: the parent that this view will eventually be attached to
Return
View! a android.view.View corresponding to the data at the specified position.