Share via


CursorAdapter Constructors

Definition

Overloads

CursorAdapter(Context, ICursor)
Obsolete.

Constructor that always enables auto-requery.

CursorAdapter(IntPtr, JniHandleOwnership)

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

CursorAdapter(Context, ICursor, CursorAdapterFlags)

Recommended constructor.

CursorAdapter(Context, ICursor, Boolean)

Constructor that allows control over auto-requery.

CursorAdapter(Context, ICursor)

Caution

deprecated

Constructor that always enables auto-requery.

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/database/Cursor;)V", "")]
[System.Obsolete("deprecated")]
public CursorAdapter (Android.Content.Context? context, Android.Database.ICursor? c);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/database/Cursor;)V", "")>]
[<System.Obsolete("deprecated")>]
new Android.Widget.CursorAdapter : Android.Content.Context * Android.Database.ICursor -> Android.Widget.CursorAdapter

Parameters

context
Context

The context

c
ICursor

The cursor from which to get the data.

Attributes

Remarks

Constructor that always enables auto-requery.

This member is deprecated. This option is discouraged, as it results in Cursor queries being performed on the application's UI thread and thus can cause poor responsiveness or even Application Not Responding errors. As an alternative, use android.app.LoaderManager with a android.content.CursorLoader.

Java documentation for android.widget.CursorAdapter.CursorAdapter(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

CursorAdapter(IntPtr, JniHandleOwnership)

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

protected CursorAdapter (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Widget.CursorAdapter : nativeint * Android.Runtime.JniHandleOwnership -> Android.Widget.CursorAdapter

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

Remarks

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

CursorAdapter(Context, ICursor, CursorAdapterFlags)

Recommended constructor.

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/database/Cursor;I)V", "")]
public CursorAdapter (Android.Content.Context? context, Android.Database.ICursor? c, Android.Widget.CursorAdapterFlags flags);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/database/Cursor;I)V", "")>]
new Android.Widget.CursorAdapter : Android.Content.Context * Android.Database.ICursor * Android.Widget.CursorAdapterFlags -> Android.Widget.CursorAdapter

Parameters

context
Context

The context

c
ICursor

The cursor from which to get the data.

flags
CursorAdapterFlags

Flags used to determine the behavior of the adapter; may be any combination of #FLAG_AUTO_REQUERY and #FLAG_REGISTER_CONTENT_OBSERVER.

Attributes

Remarks

Recommended constructor.

Java documentation for android.widget.CursorAdapter.CursorAdapter(android.content.Context, android.database.Cursor, int).

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

CursorAdapter(Context, ICursor, Boolean)

Constructor that allows control over auto-requery.

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/database/Cursor;Z)V", "")]
public CursorAdapter (Android.Content.Context? context, Android.Database.ICursor? c, bool autoRequery);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/database/Cursor;Z)V", "")>]
new Android.Widget.CursorAdapter : Android.Content.Context * Android.Database.ICursor * bool -> Android.Widget.CursorAdapter

Parameters

context
Context

The context

c
ICursor

The cursor from which to get the data.

autoRequery
Boolean

If true the adapter will call requery() on the cursor whenever it changes so the most recent data is always displayed. Using true here is discouraged.

Attributes

Remarks

Constructor that allows control over auto-requery. It is recommended you not use this, but instead #CursorAdapter(Context, Cursor, int). When using this constructor, #FLAG_REGISTER_CONTENT_OBSERVER will always be set.

Java documentation for android.widget.CursorAdapter.CursorAdapter(android.content.Context, android.database.Cursor, boolean).

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