CursorAdapter | Android Developers

Class Overview

Adapter that exposes data from a Cursor to a ListView widget.

The Cursor must include a column named "_id" or this class will not work.
Additionally, using MergeCursor with this class will not work
if the merged Cursors have overlapping values in their "_id" columns.

※_idはXXXContractクラス内のXXXEntryクラス(public static final)でimplements BaseColumnsとすれば、自動的に生成されます。

Public Constructors

CursorAdapter(Context context, Cursor c, int flags)
Recommended constructor.


  • bindView(View view, Context context, Cursor cursor)
Bind an existing view to the data pointed to by cursor

※子ビューはCursorAdapterの小クラス内のpublic static classでキャッシュします

  • newView(Context context, Cursor cursor, ViewGroup parent)
Makes a new view to hold the data pointed to by cursor.


  • LayoutInflater
Instantiates a layout XML file into its corresponding View objects.

LayoutInflater | Android Developers

  • setTag (Object tag)
Sets the tag associated with this view.
A tag can be used to mark a view in its hierarchy
and does not have to be unique within the hierarchy.

Tags can also be used to store data within a view without resorting to another data structure.


implements LoaderManager.LoaderCallbacks<Cursor>
  • LoaderManagerとは
    Interface associated with an Activity or Fragment for managing one or more Loader instances associated with it.

This helps an application manage longer-running operations in conjunction with the Activity or Fragment lifecycle; the most common use of this is with a CursorLoader, however applications are free to write their own loaders for loading other types of data.

While the LoaderManager API was introduced in HONEYCOMB, a version of the API at is also available for use on older platforms through FragmentActivity.

See the blog post Fragments For All for more details.


LoaderManager | Android Developers

  • LoaderManager.LoaderCallbacksとは
Callback interface for a client to interact with the manager.