FileDocCategorySizeDatePackage
ResourceCursorAdapter.javaAPI DocAndroid 5.1 API5496Thu Mar 12 22:22:56 GMT 2015android.support.v4.widget

ResourceCursorAdapter

public abstract class ResourceCursorAdapter extends CursorAdapter
Static library support version of the framework's {@link android.widget.ResourceCursorAdapter}. Used to write apps that run on platforms prior to Android 3.0. When running on Android 3.0 or above, this implementation is still used; it does not try to switch to the framework's implementation. See the framework SDK documentation for a class overview.

Fields Summary
private int
mLayout
private int
mDropDownLayout
private android.view.LayoutInflater
mInflater
Constructors Summary
public ResourceCursorAdapter(android.content.Context context, int layout, android.database.Cursor c)
Constructor the enables auto-requery.

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 {@link android.app.LoaderManager} with a {@link android.content.CursorLoader}.
param
context The context where the ListView associated with this adapter is running
param
layout 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.

        super(context, c);
        mLayout = mDropDownLayout = layout;
        mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    
public ResourceCursorAdapter(android.content.Context context, int layout, android.database.Cursor c, boolean autoRequery)
Constructor with default behavior as per {@link CursorAdapter#CursorAdapter(Context, Cursor, boolean)}; it is recommended you not use this, but instead {@link #ResourceCursorAdapter(Context, int, Cursor, int)}. When using this constructor, {@link #FLAG_REGISTER_CONTENT_OBSERVER} will always be set.

param
context The context where the ListView associated with this adapter is running
param
layout 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.
param
c The cursor from which to get the data.
param
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.

        super(context, c, autoRequery);
        mLayout = mDropDownLayout = layout;
        mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    
public ResourceCursorAdapter(android.content.Context context, int layout, android.database.Cursor c, int flags)
Standard constructor.

param
context The context where the ListView associated with this adapter is running
param
layout 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.
param
c The cursor from which to get the data.
param
flags Flags used to determine the behavior of the adapter, as per {@link CursorAdapter#CursorAdapter(Context, Cursor, int)}.

        super(context, c, flags);
        mLayout = mDropDownLayout = layout;
        mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    
Methods Summary
public android.view.ViewnewDropDownView(android.content.Context context, android.database.Cursor cursor, android.view.ViewGroup parent)

        return mInflater.inflate(mDropDownLayout, parent, false);
    
public android.view.ViewnewView(android.content.Context context, android.database.Cursor cursor, android.view.ViewGroup parent)
Inflates view(s) from the specified XML file.

see
android.widget.CursorAdapter#newView(android.content.Context, android.database.Cursor, ViewGroup)

        return mInflater.inflate(mLayout, parent, false);
    
public voidsetDropDownViewResource(int dropDownLayout)

Sets the layout resource of the drop down views.

param
dropDownLayout the layout resources used to create drop down views

        mDropDownLayout = dropDownLayout;
    
public voidsetViewResource(int layout)

Sets the layout resource of the item views.

param
layout the layout resources used to create item views

        mLayout = layout;