Android Guides | Samples

Android.Widget.SimpleAdapter Class

An easy adapter to map static data to views defined in an XML file.

See Also: SimpleAdapter

Syntax

[Android.Runtime.Register("android/widget/SimpleAdapter", DoNotGenerateAcw=true)]
public class SimpleAdapter : BaseAdapter, IFilterable, IDisposable

Remarks

An easy adapter to map static data to views defined in an XML file. You can specify the data backing the list as an ArrayList of Maps. Each entry in the ArrayList corresponds to one row in the list. The Maps contain the data for each row. You also specify an XML file that defines the views used to display the row, and a mapping from keys in the Map to specific views. Binding data to views occurs in two phases. First, if a NoType:android/widget/SimpleAdapter$ViewBinder;Href=../../../reference/android/widget/SimpleAdapter.ViewBinder.html is available, NoType:android/widget/SimpleAdapter$ViewBinder;Href=../../../reference/android/widget/SimpleAdapter.ViewBinder.html#setViewValue(android.view.View, java.lang.Object, java.lang.String) is invoked. If the returned value is true, binding has occurred. If the returned value is false, the following views are then tried in order:

If no appropriate binding can be found, an IllegalStateException is thrown.

[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.SimpleAdapter are listed below.

See Also: BaseAdapter

Public Constructors

Protected Constructors

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

Public Properties

[read-only]
override
CountInt32. How many items are in the data set represented by this Adapter.
[read-only]
FilterFilter.
ViewBinderSimpleAdapter+IViewBinder. Returns the NoType:android/widget/SimpleAdapter$ViewBinder;Href=../../../reference/android/widget/SimpleAdapter.ViewBinder.html used to bind data to views.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

override
GetItem(Int32) : Object
Get the data item associated with the specified position in the data set.
override
GetItemId(Int32) : Int64
Get the row id associated with the specified position in the list.
override
GetView(Int32, View, ViewGroup) : View
Get a View that displays the data at the specified position in the data set.
SetDropDownViewResource(Int32)
SetViewImage(ImageView, Int32)
Called by bindView() to set the image for an ImageView but only if there is no existing ViewBinder or if the existing ViewBinder cannot handle binding to an ImageView.
SetViewImage(ImageView, String)
Called by bindView() to set the image for an ImageView but only if there is no existing ViewBinder or if the existing ViewBinder cannot handle binding to an ImageView.
SetViewText(TextView, String)
Called by bindView() to set the text for a TextView but only if there is no existing ViewBinder or if the existing ViewBinder cannot handle binding to a TextView.