ResourceCursorAdapter
public
abstract
class
ResourceCursorAdapter
extends CursorAdapter
Known direct subclasses
SimpleCursorAdapter |
An easy adapter to map columns from a cursor to TextViews or ImageViews
defined in an XML file.
|
|
An easy adapter that creates views defined in an XML file. You can specify
the XML file that defines the appearance of the views.
Summary
Public constructors |
ResourceCursorAdapter(Context context, int layout, Cursor c)
This constructor is 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(android.content.Context, int, android.database.Cursor, int) .
|
ResourceCursorAdapter(Context context, int layout, Cursor c, int flags)
Standard constructor.
|
Inherited methods |
From class
android.widget.CursorAdapter
abstract
void
|
bindView(View view, Context context, Cursor cursor)
Bind an existing view to the data pointed to by cursor
|
void
|
changeCursor(Cursor cursor)
Change the underlying cursor to a new cursor.
|
CharSequence
|
convertToString(Cursor cursor)
Converts the cursor into a CharSequence.
|
int
|
getCount()
How many items are in the data set represented by this Adapter.
|
Cursor
|
getCursor()
Returns the cursor.
|
View
|
getDropDownView(int position, View convertView, ViewGroup parent)
Gets a View that displays in the drop down popup
the data at the specified position in the data set.
|
Resources.Theme
|
getDropDownViewTheme()
Returns the value previously set by a call to
setDropDownViewTheme(android.content.res.Resources.Theme) .
|
Filter
|
getFilter()
Returns a filter that can be used to constrain data with a filtering
pattern.
|
FilterQueryProvider
|
getFilterQueryProvider()
Returns the query filter provider used for filtering.
|
Object
|
getItem(int position)
Get the data item associated with the specified position in the data set.
|
long
|
getItemId(int position)
Get the row id associated with the specified position in the list.
|
View
|
getView(int position, View convertView, ViewGroup parent)
Get a View that displays the data at the specified position in the data set.
|
boolean
|
hasStableIds()
Indicates whether the item ids are stable across changes to the
underlying data.
|
void
|
init(Context context, Cursor c, boolean autoRequery)
This method was deprecated
in API level 15.
Don't use this, use the normal constructor. This will
be removed in the future.
|
View
|
newDropDownView(Context context, Cursor cursor, ViewGroup parent)
Makes a new drop down view to hold the data pointed to by cursor.
|
abstract
View
|
newView(Context context, Cursor cursor, ViewGroup parent)
Makes a new view to hold the data pointed to by cursor.
|
void
|
onContentChanged()
Called when the ContentObserver on the cursor receives a change notification.
|
Cursor
|
runQueryOnBackgroundThread(CharSequence constraint)
Runs a query with the specified constraint.
|
void
|
setDropDownViewTheme(Resources.Theme theme)
Sets the Resources.Theme against which drop-down views are
inflated.
|
void
|
setFilterQueryProvider(FilterQueryProvider filterQueryProvider)
Sets the query filter provider used to filter the current Cursor.
|
Cursor
|
swapCursor(Cursor newCursor)
Swap in a new Cursor, returning the old Cursor.
|
|
From class
android.widget.BaseAdapter
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
From interface
android.widget.Filterable
abstract
Filter
|
getFilter()
Returns a filter that can be used to constrain data with a filtering
pattern.
|
|
From interface
android.widget.ThemedSpinnerAdapter
|
From interface
android.widget.ListAdapter
abstract
boolean
|
areAllItemsEnabled()
Indicates whether all the items in this adapter are enabled.
|
abstract
boolean
|
isEnabled(int position)
Returns true if the item at the specified position is not a separator.
|
|
From interface
android.widget.SpinnerAdapter
abstract
View
|
getDropDownView(int position, View convertView, ViewGroup parent)
Gets a View that displays in the drop down popup
the data at the specified position in the data set.
|
|
From interface
android.widget.Adapter
|
Public constructors
ResourceCursorAdapter
public ResourceCursorAdapter (Context context,
int layout,
Cursor c)
This constructor is 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
.
Constructor the enables auto-requery.
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
public 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(android.content.Context, int, android.database.Cursor, int)
.
When using this constructor, CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER
will always be set.
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
public ResourceCursorAdapter (Context context,
int layout,
Cursor c,
int flags)
Standard constructor.
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.CursorAdapter(Context, Cursor, int) . |
Public methods
newDropDownView
public View newDropDownView (Context context,
Cursor cursor,
ViewGroup parent)
Makes a new drop down view to hold the data pointed to by cursor.
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. |
newView
public View newView (Context context,
Cursor cursor,
ViewGroup parent)
Inflates view(s) from the specified XML file.
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. |
setDropDownViewResource
public void setDropDownViewResource (int dropDownLayout)
Sets the layout resource of the drop down views.
Parameters |
dropDownLayout |
int : the layout resources used to create drop down views |
setDropDownViewTheme
public void setDropDownViewTheme (Resources.Theme theme)
Sets the Resources.Theme
against which drop-down views are
inflated.
By default, drop-down views are inflated against the theme of the
Context
passed to the adapter's constructor.
Parameters |
theme |
Resources.Theme : the theme against which to inflate drop-down views or
null to use the theme from the adapter's context |
setViewResource
public void setViewResource (int layout)
Sets the layout resource of the item views.
Parameters |
layout |
int : the layout resources used to create item views |