FileDocCategorySizeDatePackage
ResourceCursorAdapter.javaAPI DocAndroid 1.5 API3748Wed May 06 22:41:56 BST 2009android.widget

ResourceCursorAdapter

public abstract class ResourceCursorAdapter extends CursorAdapter
An easy adapter that creates views defined in an XML file. You can specify the XML file that defines the appearance of the views.

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.

param
context The context where the ListView associated with this SimpleListItemFactory 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.

param
context The context where the ListView associated with this SimpleListItemFactory 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.

        super(context, c, autoRequery);
        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;