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

Syntax

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

Type Parameters

T

Remarks

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]

Requirements

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

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

See Also: ArrayAdapter

Public Constructors

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

Public Methods

Add(T)
static
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)
Remove(T)
Sort(IComparator)