public abstract class ResourceCursorAdapter extends CursorAdapter
FLAG_AUTO_REQUERY, FLAG_REGISTER_CONTENT_OBSERVER, mAutoRequery, mChangeObserver, mContext, mCursor, mCursorFilter, mDataSetObserver, mDataValid, mFilterQueryProvider, mRowIDColumn
IGNORE_ITEM_VIEW_TYPE, NO_SELECTION
Constructor and Description |
---|
ResourceCursorAdapter(Context context,
int layout,
Cursor c)
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
LoaderManager with a CursorLoader . |
ResourceCursorAdapter(Context context,
int layout,
Cursor c,
boolean autoRequery)
Constructor with default behavior as per
CursorAdapter.CursorAdapter(Context, Cursor, boolean) ; it is recommended
you not use this, but instead ResourceCursorAdapter(Context, int, Cursor, int) . |
ResourceCursorAdapter(Context context,
int layout,
Cursor c,
int flags)
Standard constructor.
|
Modifier and Type | Method and Description |
---|---|
View |
newDropDownView(Context context,
Cursor cursor,
ViewGroup parent)
Makes a new drop down view to hold the data pointed to by cursor.
|
View |
newView(Context context,
Cursor cursor,
ViewGroup parent)
Inflates view(s) from the specified XML file.
|
void |
setDropDownViewResource(int dropDownLayout)
Sets the layout resource of the drop down views.
|
void |
setViewResource(int layout)
Sets the layout resource of the item views.
|
bindView, changeCursor, convertToString, getCount, getCursor, getDropDownView, getFilter, getFilterQueryProvider, getItem, getItemId, getView, hasStableIds, init, onContentChanged, runQueryOnBackgroundThread, setFilterQueryProvider, swapCursor
areAllItemsEnabled, getItemViewType, getViewTypeCount, isEmpty, isEnabled, notifyDataSetChanged, notifyDataSetInvalidated, registerDataSetObserver, unregisterDataSetObserver
@Deprecated public ResourceCursorAdapter(Context context, int layout, Cursor c)
LoaderManager
with a CursorLoader
.context
- The context where the ListView associated with this adapter is runninglayout
- 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.public ResourceCursorAdapter(Context context, int layout, Cursor c, boolean autoRequery)
CursorAdapter.CursorAdapter(Context, Cursor, boolean)
; it is recommended
you not use this, but instead ResourceCursorAdapter(Context, int, Cursor, int)
.
When using this constructor, CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER
will always be set.context
- The context where the ListView associated with this adapter is runninglayout
- 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
- The cursor from which to get the data.autoRequery
- 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.public ResourceCursorAdapter(Context context, int layout, Cursor c, int flags)
context
- The context where the ListView associated with this adapter is runninglayout
- 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
- The cursor from which to get the data.flags
- Flags used to determine the behavior of the adapter,
as per CursorAdapter.CursorAdapter(Context, Cursor, int)
.public View newView(Context context, Cursor cursor, ViewGroup parent)
newView
in class CursorAdapter
context
- Interface to application's global informationcursor
- The cursor from which to get the data. The cursor is already
moved to the correct position.parent
- The parent to which the new view is attached toCursorAdapter.newView(android.content.Context,
android.database.Cursor, ViewGroup)
public View newDropDownView(Context context, Cursor cursor, ViewGroup parent)
CursorAdapter
newDropDownView
in class CursorAdapter
context
- Interface to application's global informationcursor
- The cursor from which to get the data. The cursor is already
moved to the correct position.parent
- The parent to which the new view is attached topublic void setViewResource(int layout)
Sets the layout resource of the item views.
layout
- the layout resources used to create item viewspublic void setDropDownViewResource(int dropDownLayout)
Sets the layout resource of the drop down views.
dropDownLayout
- the layout resources used to create drop down views