SimpleCursorAdapter.BindView(View, Context, ICursor) Method

Definition

Binds all of the field names passed into the "to" parameter of the constructor with their corresponding cursor columns as specified in the "from" parameter.

[Android.Runtime.Register("bindView", "(Landroid/view/View;Landroid/content/Context;Landroid/database/Cursor;)V", "GetBindView_Landroid_view_View_Landroid_content_Context_Landroid_database_Cursor_Handler")]
public override void BindView (Android.Views.View? view, Android.Content.Context? context, Android.Database.ICursor? cursor);
[<Android.Runtime.Register("bindView", "(Landroid/view/View;Landroid/content/Context;Landroid/database/Cursor;)V", "GetBindView_Landroid_view_View_Landroid_content_Context_Landroid_database_Cursor_Handler")>]
override this.BindView : Android.Views.View * Android.Content.Context * Android.Database.ICursor -> unit

Parameters

view
View

Existing view, returned earlier by newView

context
Context

Interface to application's global information

cursor
ICursor

The cursor from which to get the data. The cursor is already moved to the correct position.

Attributes

Exceptions

if binding cannot occur

Remarks

Binds all of the field names passed into the "to" parameter of the constructor with their corresponding cursor columns as specified in the "from" parameter.

Binding occurs in two phases. First, if a android.widget.SimpleCursorAdapter.ViewBinder is available, ViewBinder#setViewValue(android.view.View, android.database.Cursor, int) is invoked. If the returned value is true, binding has occured. If the returned value is false and the view to bind is a TextView, #setViewText(TextView, String) is invoked. If the returned value is false and the view to bind is an ImageView, #setViewImage(ImageView, String) is invoked. If no appropriate binding can be found, an IllegalStateException is thrown.

Java documentation for android.widget.SimpleCursorAdapter.bindView(android.view.View, android.content.Context, android.database.Cursor).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also

  • <xref:Android.Widget.CursorAdapter.BindView(Android.Views.View%2c+Android.Content.Context%2c+Android.Content.Context)>
  • ViewBinder
  • <xref:Android.Widget.SimpleCursorAdapter.SetViewImage(Android.Widget.ImageView%2c+System.String)>
  • <xref:Android.Widget.SimpleCursorAdapter.SetViewText(Android.Widget.TextView%2c+System.String)>