public abstract class ResourceCursorAdapter
extends CursorAdapter
| java.lang.Object | |||
| android.widget.BaseAdapter | |||
| android.support.v4.widget.CursorAdapter | |||
| android.support.v4.widget.ResourceCursorAdapter | |||
| |
静态库支持版本的框架ResourceCursorAdapter 。 用于编写在Android 3.0之前的平台上运行的应用程序。 在Android 3.0或更高版本上运行时,此实现仍在使用; 它不会尝试切换到框架的实现。 请参阅框架SDK文档以了解类概述。
Inherited constants |
|---|
android.support.v4.widget.CursorAdapter
|
android.widget.Adapter
|
Public constructors |
|
|---|---|
ResourceCursorAdapter(Context context, int layout, Cursor c) 此构造函数已弃用。 不鼓励使用此选项,因为它会导致在应用程序的UI线程上执行游标查询,因此可能导致响应性较差甚至出现应用程序无响应错误。 作为替代,请使用 |
|
ResourceCursorAdapter(Context context, int layout, Cursor c, boolean autoRequery) 此构造函数已弃用。 不鼓励使用此选项,因为它会导致在应用程序的UI线程上执行游标查询,因此可能导致响应性较差甚至出现应用程序无响应错误。 作为一种替代方案,请使用 |
|
ResourceCursorAdapter(Context context, int layout, Cursor c, int flags) 标准构造函数。 |
|
公共方法(Public methods) |
|
|---|---|
View |
newDropDownView(Context context, Cursor cursor, ViewGroup parent) 创建一个新的下拉视图来保存指针指向的数据。 |
View |
newView(Context context, Cursor cursor, ViewGroup parent) 从指定的XML文件膨胀视图。 |
void |
setDropDownViewResource(int dropDownLayout) 设置下拉视图的布局资源。 |
void |
setViewResource(int layout) 设置项目视图的布局资源。 |
继承方法(Inherited methods) |
|
|---|---|
android.support.v4.widget.CursorAdapter
|
|
android.widget.BaseAdapter
|
|
java.lang.Object
|
|
android.widget.Filterable
|
|
android.widget.ListAdapter
|
|
android.widget.SpinnerAdapter
|
|
android.widget.Adapter
|
|
ResourceCursorAdapter (Context context, int layout, Cursor c)
此构造函数已弃用。
不鼓励使用此选项,因为它会导致在应用程序的UI线程上执行游标查询,因此可能导致响应性较差甚至出现应用程序无响应错误。 作为替代,使用LoaderManager和CursorLoader 。
构造函数使能自动重新查询。
| 参数(Parameters) | |
|---|---|
context |
Context: The context where the ListView associated with this adapter is running |
layout |
int: resource identifier of a layout file that defines the views for this list item. Unless you override them later, this will define both the item views and the drop down views. |
c |
Cursor
|
ResourceCursorAdapter (Context context, int layout, Cursor c, boolean autoRequery)
此构造函数已弃用。
不鼓励使用此选项,因为它会导致在应用程序的UI线程上执行游标查询,因此可能导致响应性较差甚至出现应用程序无响应错误。 作为替代,使用LoaderManager和CursorLoader 。
构造函数具有按照CursorAdapter(Context, Cursor, boolean)默认行为; 建议你不要使用这个,而是ResourceCursorAdapter(Context, int, Cursor, int) 。 使用此构造函数时,将始终设置FLAG_REGISTER_CONTENT_OBSERVER 。
| 参数(Parameters) | |
|---|---|
context |
Context: The context where the ListView associated with this adapter is running |
layout |
int: resource identifier of a layout file that defines the views for this list item. Unless you override them later, this will define both the item views and the drop down views. |
c |
Cursor: 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. |
ResourceCursorAdapter (Context context, int layout, Cursor c, int flags)
标准构造函数。
| 参数(Parameters) | |
|---|---|
context |
Context: The context where the ListView associated with this adapter is running |
layout |
int: Resource identifier of a layout file that defines the views for this list item. Unless you override them later, this will define both the item views and the drop down views. |
c |
Cursor: The cursor from which to get the data. |
flags |
int: Flags used to determine the behavior of the adapter, as per CursorAdapter(Context, Cursor, int). |
View newDropDownView (Context context, Cursor cursor, ViewGroup parent)
创建一个新的下拉视图来保存指针指向的数据。
| 参数(Parameters) | |
|---|---|
context |
Context: Interface to application's global information |
cursor |
Cursor: The cursor from which to get the data. The cursor is already moved to the correct position. |
parent |
ViewGroup: The parent to which the new view is attached to |
| 返回(Returns) | |
|---|---|
View |
the newly created view. |
View newView (Context context, Cursor cursor, ViewGroup parent)
从指定的XML文件膨胀视图。
| 参数(Parameters) | |
|---|---|
context |
Context: Interface to application's global information |
cursor |
Cursor: The cursor from which to get the data. The cursor is already moved to the correct position. |
parent |
ViewGroup: The parent to which the new view is attached to |
| 返回(Returns) | |
|---|---|
View |
the newly created view. |
void setDropDownViewResource (int dropDownLayout)
设置下拉视图的布局资源。
| 参数(Parameters) | |
|---|---|
dropDownLayout |
int: the layout resources used to create drop down views |
void setViewResource (int layout)
Sets the layout resource of the item views.
| 参数(Parameters) | |
|---|---|
layout |
int: the layout resources used to create item views |