SimpleCursorAdapter 构造函数

定义

重载

名称 说明
SimpleCursorAdapter(IntPtr, JniHandleOwnership)

创建 JNI 对象的托管表示形式时使用的构造函数;由运行时调用。

SimpleCursorAdapter(Context, Int32, ICursor, String[], Int32[])
已过时.

启用自动重新查询的构造函数。

SimpleCursorAdapter(Context, Int32, ICursor, String[], Int32[], CursorAdapterFlags)

标准构造函数。

SimpleCursorAdapter(IntPtr, JniHandleOwnership)

创建 JNI 对象的托管表示形式时使用的构造函数;由运行时调用。

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

参数

javaReference
IntPtr

nativeint

IntPtr一个包含Java本机接口 (JNI) 对象引用。

transfer
JniHandleOwnership

指示 JniHandleOwnership如何处理 javaReference

注解

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

SimpleCursorAdapter(Context, Int32, ICursor, String[], Int32[])

注意

deprecated

启用自动重新查询的构造函数。

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;ILandroid/database/Cursor;[Ljava/lang/String;[I)V", "")]
[System.Obsolete("deprecated")]
public SimpleCursorAdapter(Android.Content.Context? context, int layout, Android.Database.ICursor? c, string[]? from, int[]? to);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;ILandroid/database/Cursor;[Ljava/lang/String;[I)V", "")>]
[<System.Obsolete("deprecated")>]
new Android.Widget.SimpleCursorAdapter : Android.Content.Context * int * Android.Database.ICursor * string[] * int[] -> Android.Widget.SimpleCursorAdapter

参数

context
Context
layout
Int32
from
String[]
to
Int32[]
属性

注解

启用自动重新查询的构造函数。

此成员已弃用。 不建议使用此选项,因为它会导致对应用程序的 UI 线程执行游标查询,因此可能会导致响应能力差,甚至应用程序未响应错误。 作为替代方法,与 android.app.LoaderManager ..android.content.CursorLoader

Java文档android.widget.SimpleCursorAdapter.SimpleCursorAdapter(android.content.Context, int, android.database.Cursor, java.lang.String[], int[])

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

SimpleCursorAdapter(Context, Int32, ICursor, String[], Int32[], CursorAdapterFlags)

标准构造函数。

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;ILandroid/database/Cursor;[Ljava/lang/String;[II)V", "")]
public SimpleCursorAdapter(Android.Content.Context? context, int layout, Android.Database.ICursor? c, string[]? from, int[]? to, Android.Widget.CursorAdapterFlags flags);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;ILandroid/database/Cursor;[Ljava/lang/String;[II)V", "")>]
new Android.Widget.SimpleCursorAdapter : Android.Content.Context * int * Android.Database.ICursor * string[] * int[] * Android.Widget.CursorAdapterFlags -> Android.Widget.SimpleCursorAdapter

参数

context
Context

与此 SimpleListItemFactory 关联的 ListView 正在运行的上下文

layout
Int32

用于定义此列表项视图的布局文件的资源标识符。 布局文件应至少包括“to”中定义的命名视图

c
ICursor

数据库游标。 如果游标尚不可用,可以为 null。

from
String[]

表示要绑定到 UI 的数据的列名列表。 如果游标尚不可用,可以为 null。

to
Int32[]

应在“from”参数中显示列的视图。 这些应全部为 TextViews。 此列表中的第一个 N 视图给定参数中第一个 N 列的值。 如果游标尚不可用,可以为 null。

flags
CursorAdapterFlags

用于根据以下情况确定适配器 CursorAdapter#CursorAdapter(Context, Cursor, int)行为的标志。

属性

注解

标准构造函数。

Java文档android.widget.SimpleCursorAdapter.SimpleCursorAdapter(android.content.Context, int, android.database.Cursor, java.lang.String[], int[], int)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于