Android Guides | Samples

Android.Widget.ArrayAdapter<T> Class

A concrete BaseAdapter that is backed by an array of arbitrary objects.

See Also: ArrayAdapter<T> Members


[Android.Runtime.Register("android/widget/ArrayAdapter", DoNotGenerateAcw=true)]
public class ArrayAdapter<T> : ArrayAdapter

Type Parameters



A concrete BaseAdapter that is backed by an array of arbitrary objects. By default this class expects that the provided resource id references a single TextView. If you want to use a more complex layout, use the constructors that also takes a field id. That field id should reference a TextView in the larger layout resource.

However the TextView is referenced, it will be filled with the toString() of each object in the array. You can add lists or arrays of custom objects. Override the toString() method of your objects to determine what text will be displayed for the item in the list.

To use something other than TextViews for the array display, for instance, ImageViews, or to have some of data besides toString() results fill the views, override ArrayAdapter`1.getView(int, android.view.View, android.view.ViewGroup) to return the type of view you want.

[Android Documentation]


Namespace: Android.Widget
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions:
Since: Added in API level 1

The members of Android.Widget.ArrayAdapter<T> are listed below.

See Also: ArrayAdapter

Public Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Methods

CreateFromResource(Context, Int32, Int32) : ArrayAdapter<Java.Lang.ICharSequence>
Creates a new ArrayAdapter from external resources.
GetItem(Int32) : T
Get the data item associated with the specified position in the data set.
GetPosition(T) : Int32
Insert(T, Int32)