added in version 22.1.0
belongs to Maven artifact com.android.support:loader:28.0.0-alpha1

CursorLoader

public class CursorLoader
extends AsyncTaskLoader<Cursor>

java.lang.Object
   ↳ android.support.v4.content.Loader<android.database.Cursor>
     ↳ android.support.v4.content.AsyncTaskLoader<android.database.Cursor>
       ↳ android.support.v4.content.CursorLoader


Static library support version of the framework's CursorLoader. 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.

Summary

Public constructors

CursorLoader(Context context)

Creates an empty unspecified CursorLoader.

CursorLoader(Context context, Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)

Creates a fully-specified CursorLoader.

Public methods

void cancelLoadInBackground()

Called on the main thread to abort a load in progress.

void deliverResult(Cursor cursor)

Sends the result of the load to the registered listener.

void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args)

Print the Loader's state into the given stream.

String[] getProjection()
String getSelection()
String[] getSelectionArgs()
String getSortOrder()
Uri getUri()
Cursor loadInBackground()

Called on a worker thread to perform the actual load and to return the result of the load operation.

void onCanceled(Cursor cursor)

Called if the task was canceled before it was completed.

void setProjection(String[] projection)
void setSelection(String selection)
void setSelectionArgs(String[] selectionArgs)
void setSortOrder(String sortOrder)
void setUri(Uri uri)

Protected methods

void onReset()

Subclasses must implement this to take care of resetting their loader, as per reset().

void onStartLoading()

Starts an asynchronous load of the contacts list data.

void onStopLoading()

Must be called from the UI thread

Inherited methods

From class android.support.v4.content.AsyncTaskLoader