# CursorLoader

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:loader:28.0.0-alpha1  
Summary:[Ctors](https://developer.android.com/reference/android/support/v4/content/CursorLoader#pubctors)\|[Methods](https://developer.android.com/reference/android/support/v4/content/CursorLoader#pubmethods)\|[Protected Methods](https://developer.android.com/reference/android/support/v4/content/CursorLoader#promethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4/content/CursorLoader#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4/content/CursorLoader#)  

# CursorLoader

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


class
CursorLoader
`  
`


``


``

extends `[AsyncTaskLoader](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader)`<`[Cursor](https://developer.android.com/reference/android/database/Cursor.html)`>


``


`

|---|---|---|-----------------------------------------|
| java.lang.Object                                 ||||
| ↳ | [android.support.v4.content.Loader](https://developer.android.com/reference/android/support/v4/content/Loader)\<[android.database.Cursor](https://developer.android.com/reference/android/database/Cursor.html)\> |||
|   | ↳ | [android.support.v4.content.AsyncTaskLoader](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader)\<[android.database.Cursor](https://developer.android.com/reference/android/database/Cursor.html)\> ||
|   |   | ↳ | android.support.v4.content.CursorLoader |

<br />

*** ** * ** ***

Static library support version of the framework's[CursorLoader](https://developer.android.com/reference/android/content/CursorLoader.html). 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](https://developer.android.com/reference/android/support/v4/content/CursorLoader#CursorLoader(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context) ` Creates an empty unspecified CursorLoader.                                                                                                                                                                                                                                                       |
| ` `[CursorLoader](https://developer.android.com/reference/android/support/v4/content/CursorLoader#CursorLoader(android.content.Context, android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, `[Uri](https://developer.android.com/reference/android/net/Uri.html)` uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) ` Creates a fully-specified CursorLoader. |

|                                                                                                                                                                                      ### Public methods                                                                                                                                                                                       ||
|-----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`                                                                           | ` `[cancelLoadInBackground](https://developer.android.com/reference/android/support/v4/content/CursorLoader#cancelLoadInBackground())`() ` Called on the main thread to abort a load in progress.                                                                                                          |
| ` void`                                                                           | ` `[deliverResult](https://developer.android.com/reference/android/support/v4/content/CursorLoader#deliverResult(android.database.Cursor))`(`[Cursor](https://developer.android.com/reference/android/database/Cursor.html)` cursor) ` Sends the result of the load to the registered listener.            |
| ` void`                                                                           | ` `[dump](https://developer.android.com/reference/android/support/v4/content/CursorLoader#dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]))`(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) ` Print the Loader's state into the given stream. |
| ` String[]`                                                                       | ` `[getProjection](https://developer.android.com/reference/android/support/v4/content/CursorLoader#getProjection())`() `                                                                                                                                                                                   |
| ` String`                                                                         | ` `[getSelection](https://developer.android.com/reference/android/support/v4/content/CursorLoader#getSelection())`() `                                                                                                                                                                                     |
| ` String[]`                                                                       | ` `[getSelectionArgs](https://developer.android.com/reference/android/support/v4/content/CursorLoader#getSelectionArgs())`() `                                                                                                                                                                             |
| ` String`                                                                         | ` `[getSortOrder](https://developer.android.com/reference/android/support/v4/content/CursorLoader#getSortOrder())`() `                                                                                                                                                                                     |
| ` `[Uri](https://developer.android.com/reference/android/net/Uri.html)            | ` `[getUri](https://developer.android.com/reference/android/support/v4/content/CursorLoader#getUri())`() `                                                                                                                                                                                                 |
| ` `[Cursor](https://developer.android.com/reference/android/database/Cursor.html) | ` `[loadInBackground](https://developer.android.com/reference/android/support/v4/content/CursorLoader#loadInBackground())`() ` Called on a worker thread to perform the actual load and to return the result of the load operation.                                                                        |
| ` void`                                                                           | ` `[onCanceled](https://developer.android.com/reference/android/support/v4/content/CursorLoader#onCanceled(android.database.Cursor))`(`[Cursor](https://developer.android.com/reference/android/database/Cursor.html)` cursor) ` Called if the task was canceled before it was completed.                  |
| ` void`                                                                           | ` `[setProjection](https://developer.android.com/reference/android/support/v4/content/CursorLoader#setProjection(java.lang.String[]))`(String[] projection) `                                                                                                                                              |
| ` void`                                                                           | ` `[setSelection](https://developer.android.com/reference/android/support/v4/content/CursorLoader#setSelection(java.lang.String))`(String selection) `                                                                                                                                                     |
| ` void`                                                                           | ` `[setSelectionArgs](https://developer.android.com/reference/android/support/v4/content/CursorLoader#setSelectionArgs(java.lang.String[]))`(String[] selectionArgs) `                                                                                                                                     |
| ` void`                                                                           | ` `[setSortOrder](https://developer.android.com/reference/android/support/v4/content/CursorLoader#setSortOrder(java.lang.String))`(String sortOrder) `                                                                                                                                                     |
| ` void`                                                                           | ` `[setUri](https://developer.android.com/reference/android/support/v4/content/CursorLoader#setUri(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri.html)` uri) `                                                                                                         |

|                                                                                                                                      ### Protected methods                                                                                                                                       ||
|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[onReset](https://developer.android.com/reference/android/support/v4/content/CursorLoader#onReset())`() ` Subclasses must implement this to take care of resetting their loader, as per[reset()](https://developer.android.com/reference/android/support/v4/content/Loader#reset()). |
| ` void` | ` `[onStartLoading](https://developer.android.com/reference/android/support/v4/content/CursorLoader#onStartLoading())`() ` Starts an asynchronous load of the contacts list data.                                                                                                       |
| ` void` | ` `[onStopLoading](https://developer.android.com/reference/android/support/v4/content/CursorLoader#onStopLoading())`() ` Must be called from the UI thread                                                                                                                              |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/content/CursorLoader#)From class` `[android.support.v4.content.AsyncTaskLoader](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader)` ` |--------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` void`                                                                                    | ` `[cancelLoadInBackground](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#cancelLoadInBackground())`() ` Called on the main thread to abort a load in progress.                                                                                                                                         | | ` void`                                                                                    | ` `[dump](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]))`(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) ` Print the Loader's state into the given stream.                                | | ` boolean`                                                                                 | ` `[isLoadInBackgroundCanceled](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#isLoadInBackgroundCanceled())`() ` Returns true if the current invocation of[loadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#loadInBackground())is being canceled. | | ` abstract `[Cursor](https://developer.android.com/reference/android/database/Cursor.html) | ` `[loadInBackground](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#loadInBackground())`() ` Called on a worker thread to perform the actual load and to return the result of the load operation.                                                                                                       | | ` boolean`                                                                                 | ` `[onCancelLoad](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#onCancelLoad())`() ` Subclasses must implement this to take care of requests to[cancelLoad()](https://developer.android.com/reference/android/support/v4/content/Loader#cancelLoad()).                                                  | | ` void`                                                                                    | ` `[onCanceled](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#onCanceled(D))`(`[Cursor](https://developer.android.com/reference/android/database/Cursor.html)` data) ` Called if the task was canceled before it was completed.                                                                         | | ` void`                                                                                    | ` `[onForceLoad](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#onForceLoad())`() ` Subclasses must implement this to take care of requests to[forceLoad()](https://developer.android.com/reference/android/support/v4/content/Loader#forceLoad()).                                                      | | ` `[Cursor](https://developer.android.com/reference/android/database/Cursor.html)          | ` `[onLoadInBackground](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#onLoadInBackground())`() ` Calls[loadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#loadInBackground()).                                                                      | | ` void`                                                                                    | ` `[setUpdateThrottle](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#setUpdateThrottle(long))`(long delayMS) ` Set amount to throttle updates by.                                                                                                                                                       | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/content/CursorLoader#)From class` `[android.support.v4.content.Loader](https://developer.android.com/reference/android/support/v4/content/Loader)` ` |------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` void`                                                                            | ` `[abandon](https://developer.android.com/reference/android/support/v4/content/Loader#abandon())`() ` This function will normally be called for you automatically by[LoaderManager](https://developer.android.com/reference/android/support/v4/app/LoaderManager)when restarting a Loader.                                                                                                                                                                                                                                                                                                                                                                                                                                             | | ` boolean`                                                                         | ` `[cancelLoad](https://developer.android.com/reference/android/support/v4/content/Loader#cancelLoad())`() ` Attempt to cancel the current load task.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | ` void`                                                                            | ` `[commitContentChanged](https://developer.android.com/reference/android/support/v4/content/Loader#commitContentChanged())`() ` Commit that you have actually fully processed a content change that was returned by[takeContentChanged()](https://developer.android.com/reference/android/support/v4/content/Loader#takeContentChanged()).                                                                                                                                                                                                                                                                                                                                                                                             | | ` String`                                                                          | ` `[dataToString](https://developer.android.com/reference/android/support/v4/content/Loader#dataToString(D))`(`[Cursor](https://developer.android.com/reference/android/database/Cursor.html)` data) ` For debugging, converts an instance of the Loader's data class to a string that can be printed.                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` void`                                                                            | ` `[deliverCancellation](https://developer.android.com/reference/android/support/v4/content/Loader#deliverCancellation())`() ` Informs the registered[Loader.OnLoadCanceledListener](https://developer.android.com/reference/android/support/v4/content/Loader.OnLoadCanceledListener)that the load has been canceled.                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` void`                                                                            | ` `[deliverResult](https://developer.android.com/reference/android/support/v4/content/Loader#deliverResult(D))`(`[Cursor](https://developer.android.com/reference/android/database/Cursor.html)` data) ` Sends the result of the load to the registered listener.                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` void`                                                                            | ` `[dump](https://developer.android.com/reference/android/support/v4/content/Loader#dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]))`(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) ` Print the Loader's state into the given stream.                                                                                                                                                                                                                                                                                                                                                                                                                                    | | ` void`                                                                            | ` `[forceLoad](https://developer.android.com/reference/android/support/v4/content/Loader#forceLoad())`() ` Force an asynchronous load.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` `[Context](https://developer.android.com/reference/android/content/Context.html) | ` `[getContext](https://developer.android.com/reference/android/support/v4/content/Loader#getContext())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | ` int`                                                                             | ` `[getId](https://developer.android.com/reference/android/support/v4/content/Loader#getId())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` boolean`                                                                         | ` `[isAbandoned](https://developer.android.com/reference/android/support/v4/content/Loader#isAbandoned())`() ` Return whether this loader has been abandoned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | ` boolean`                                                                         | ` `[isReset](https://developer.android.com/reference/android/support/v4/content/Loader#isReset())`() ` Return whether this load has been reset.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | | ` boolean`                                                                         | ` `[isStarted](https://developer.android.com/reference/android/support/v4/content/Loader#isStarted())`() ` Return whether this load has been started.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | ` void`                                                                            | ` `[onAbandon](https://developer.android.com/reference/android/support/v4/content/Loader#onAbandon())`() ` Subclasses implement this to take care of being abandoned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | ` boolean`                                                                         | ` `[onCancelLoad](https://developer.android.com/reference/android/support/v4/content/Loader#onCancelLoad())`() ` Subclasses must implement this to take care of requests to[cancelLoad()](https://developer.android.com/reference/android/support/v4/content/Loader#cancelLoad()).                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` void`                                                                            | ` `[onContentChanged](https://developer.android.com/reference/android/support/v4/content/Loader#onContentChanged())`() ` Called when[Loader.ForceLoadContentObserver](https://developer.android.com/reference/android/support/v4/content/Loader.ForceLoadContentObserver)detects a change.                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` void`                                                                            | ` `[onForceLoad](https://developer.android.com/reference/android/support/v4/content/Loader#onForceLoad())`() ` Subclasses must implement this to take care of requests to[forceLoad()](https://developer.android.com/reference/android/support/v4/content/Loader#forceLoad()).                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | ` void`                                                                            | ` `[onReset](https://developer.android.com/reference/android/support/v4/content/Loader#onReset())`() ` Subclasses must implement this to take care of resetting their loader, as per[reset()](https://developer.android.com/reference/android/support/v4/content/Loader#reset()).                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` void`                                                                            | ` `[onStartLoading](https://developer.android.com/reference/android/support/v4/content/Loader#onStartLoading())`() ` Subclasses must implement this to take care of loading their data, as per[startLoading()](https://developer.android.com/reference/android/support/v4/content/Loader#startLoading()).                                                                                                                                                                                                                                                                                                                                                                                                                               | | ` void`                                                                            | ` `[onStopLoading](https://developer.android.com/reference/android/support/v4/content/Loader#onStopLoading())`() ` Subclasses must implement this to take care of stopping their loader, as per[stopLoading()](https://developer.android.com/reference/android/support/v4/content/Loader#stopLoading()).                                                                                                                                                                                                                                                                                                                                                                                                                                | | ` void`                                                                            | ` `[registerListener](https://developer.android.com/reference/android/support/v4/content/Loader#registerListener(int, android.support.v4.content.Loader.OnLoadCompleteListener<D>))`(int id, `[OnLoadCompleteListener](https://developer.android.com/reference/android/support/v4/content/Loader.OnLoadCompleteListener)`<`[Cursor](https://developer.android.com/reference/android/database/Cursor.html)`> listener) ` Registers a class that will receive callbacks when a load is complete.                                                                                                                                                                                                                                          | | ` void`                                                                            | ` `[registerOnLoadCanceledListener](https://developer.android.com/reference/android/support/v4/content/Loader#registerOnLoadCanceledListener(android.support.v4.content.Loader.OnLoadCanceledListener<D>))`(`[OnLoadCanceledListener](https://developer.android.com/reference/android/support/v4/content/Loader.OnLoadCanceledListener)`<`[Cursor](https://developer.android.com/reference/android/database/Cursor.html)`> listener) ` Registers a listener that will receive callbacks when a load is canceled.                                                                                                                                                                                                                        | | ` void`                                                                            | ` `[reset](https://developer.android.com/reference/android/support/v4/content/Loader#reset())`() ` This function will normally be called for you automatically by[LoaderManager](https://developer.android.com/reference/android/support/v4/app/LoaderManager)when destroying a Loader.                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | ` void`                                                                            | ` `[rollbackContentChanged](https://developer.android.com/reference/android/support/v4/content/Loader#rollbackContentChanged())`() ` Report that you have abandoned the processing of a content change that was returned by[takeContentChanged()](https://developer.android.com/reference/android/support/v4/content/Loader#takeContentChanged())and would like to rollback to the state where there is again a pending content change.                                                                                                                                                                                                                                                                                                 | | ` final void`                                                                      | ` `[startLoading](https://developer.android.com/reference/android/support/v4/content/Loader#startLoading())`() ` This function will normally be called for you automatically by[LoaderManager](https://developer.android.com/reference/android/support/v4/app/LoaderManager)when the associated fragment/activity is being started.                                                                                                                                                                                                                                                                                                                                                                                                     | | ` void`                                                                            | ` `[stopLoading](https://developer.android.com/reference/android/support/v4/content/Loader#stopLoading())`() ` This function will normally be called for you automatically by[LoaderManager](https://developer.android.com/reference/android/support/v4/app/LoaderManager)when the associated fragment/activity is being stopped.                                                                                                                                                                                                                                                                                                                                                                                                       | | ` boolean`                                                                         | ` `[takeContentChanged](https://developer.android.com/reference/android/support/v4/content/Loader#takeContentChanged())`() ` Take the current flag indicating whether the loader's content had changed while it was stopped.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | ` String`                                                                          | ` `[toString](https://developer.android.com/reference/android/support/v4/content/Loader#toString())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | ` void`                                                                            | ` `[unregisterListener](https://developer.android.com/reference/android/support/v4/content/Loader#unregisterListener(android.support.v4.content.Loader.OnLoadCompleteListener<D>))`(`[OnLoadCompleteListener](https://developer.android.com/reference/android/support/v4/content/Loader.OnLoadCompleteListener)`<`[Cursor](https://developer.android.com/reference/android/database/Cursor.html)`> listener) ` Remove a listener that was previously added with[registerListener(int, Loader.OnLoadCompleteListener)](https://developer.android.com/reference/android/support/v4/content/Loader#registerListener(int, android.support.v4.content.Loader.OnLoadCompleteListener<D>)).                                                    | | ` void`                                                                            | ` `[unregisterOnLoadCanceledListener](https://developer.android.com/reference/android/support/v4/content/Loader#unregisterOnLoadCanceledListener(android.support.v4.content.Loader.OnLoadCanceledListener<D>))`(`[OnLoadCanceledListener](https://developer.android.com/reference/android/support/v4/content/Loader.OnLoadCanceledListener)`<`[Cursor](https://developer.android.com/reference/android/database/Cursor.html)`> listener) ` Unregisters a listener that was previously added with[registerOnLoadCanceledListener(Loader.OnLoadCanceledListener)](https://developer.android.com/reference/android/support/v4/content/Loader#registerOnLoadCanceledListener(android.support.v4.content.Loader.OnLoadCanceledListener<D>)). | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/content/CursorLoader#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public constructors

### CursorLoader

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
CursorLoader (Context context)
```

Creates an empty unspecified CursorLoader. You must follow this with calls to[setUri(Uri)](https://developer.android.com/reference/android/support/v4/content/CursorLoader#setUri(android.net.Uri)),[setSelection(String)](https://developer.android.com/reference/android/support/v4/content/CursorLoader#setSelection(java.lang.String)), etc to specify the query to perform.

<br />

|         Parameters          ||
|-----------|------------------|
| `context` | `Context` <br /> |

### CursorLoader

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

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

Creates a fully-specified CursorLoader. See[ContentResolver.query()](https://developer.android.com/reference/android/content/ContentResolver.html#query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String))for documentation on the meaning of the parameters. These will be passed as-is to that call.

<br />

|            Parameters             ||
|-----------------|------------------|
| `context`       | `Context` <br /> |
| `uri`           | `Uri` <br />     |
| `projection`    | `String` <br />  |
| `selection`     | `String` <br />  |
| `selectionArgs` | `String` <br />  |
| `sortOrder`     | `String` <br />  |

## Public methods

### cancelLoadInBackground

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void cancelLoadInBackground ()
```

Called on the main thread to abort a load in progress. Override this method to abort the current invocation of[loadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#loadInBackground())that is running in the background on a worker thread. This method should do nothing if[loadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#loadInBackground())has not started running or if it has already finished.

<br />

### deliverResult

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void deliverResult (Cursor cursor)
```

Sends the result of the load to the registered listener. Should only be called by subclasses. Must be called from the process's main thread.

<br />

|                    Parameters                     ||
|----------|-----------------------------------------|
| `cursor` | `Cursor`: the result of the load <br /> |

### dump

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

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

Print the Loader's state into the given stream.

<br />

|                                         Parameters                                         ||
|----------|----------------------------------------------------------------------------------|
| `prefix` | `String`: Text to print at the front of each line. <br />                        |
| `fd`     | `FileDescriptor`: The raw file descriptor that the dump is being sent to. <br /> |
| `writer` | `PrintWriter`: A PrintWriter to which the dump is to be set. <br />              |
| `args`   | `String`: Additional arguments to the dump request. <br />                       |

### getProjection

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String[] getProjection ()
```

<br />

<br />

|      Returns       ||
|------------|--------|
| `String[]` | <br /> |

### getSelection

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String getSelection ()
```

<br />

<br />

|     Returns      ||
|----------|--------|
| `String` | <br /> |

### getSelectionArgs

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String[] getSelectionArgs ()
```

<br />

<br />

|      Returns       ||
|------------|--------|
| `String[]` | <br /> |

### getSortOrder

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String getSortOrder ()
```

<br />

<br />

|     Returns      ||
|----------|--------|
| `String` | <br /> |

### getUri

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Uri getUri ()
```

<br />

<br />

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### loadInBackground

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Cursor loadInBackground ()
```

Called on a worker thread to perform the actual load and to return the result of the load operation. Implementations should not deliver the result directly, but should return them from this method, which will eventually end up calling[deliverResult(D)](https://developer.android.com/reference/android/support/v4/content/Loader#deliverResult(D))on the UI thread. If implementations need to process the results on the UI thread they may override[deliverResult(D)](https://developer.android.com/reference/android/support/v4/content/Loader#deliverResult(D))and do so there. To support cancellation, this method should periodically check the value of[isLoadInBackgroundCanceled()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#isLoadInBackgroundCanceled())and terminate when it returns true. Subclasses may also override[cancelLoadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#cancelLoadInBackground())to interrupt the load directly instead of polling[isLoadInBackgroundCanceled()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#isLoadInBackgroundCanceled()). When the load is canceled, this method may either return normally or throw[OperationCanceledException](https://developer.android.com/reference/android/support/v4/os/OperationCanceledException). In either case, the[Loader](https://developer.android.com/reference/android/support/v4/content/Loader)will call[onCanceled(D)](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#onCanceled(D))to perform post-cancellation cleanup and to dispose of the result object, if any.

<br />

|                                                         Returns                                                          ||
|--------------------------------------------------------------------------------|------------------------------------------|
| [Cursor](https://developer.android.com/reference/android/database/Cursor.html) | The result of the load operation. <br /> |

### onCanceled

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onCanceled (Cursor cursor)
```

Called if the task was canceled before it was completed. Gives the class a chance to clean up post-cancellation and to properly dispose of the result.

<br />

|                                                                                                                                                             Parameters                                                                                                                                                              ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `cursor` | `Cursor`: The value that was returned by[loadInBackground()](https://developer.android.com/reference/android/support/v4/content/CursorLoader#loadInBackground()), or null if the task threw[OperationCanceledException](https://developer.android.com/reference/android/support/v4/os/OperationCanceledException). <br /> |

### setProjection

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setProjection (String[] projection)
```

<br />

<br />

|          Parameters           ||
|--------------|-----------------|
| `projection` | `String` <br /> |

### setSelection

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setSelection (String selection)
```

<br />

<br />

|          Parameters          ||
|-------------|-----------------|
| `selection` | `String` <br /> |

### setSelectionArgs

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setSelectionArgs (String[] selectionArgs)
```

<br />

<br />

|            Parameters            ||
|-----------------|-----------------|
| `selectionArgs` | `String` <br /> |

### setSortOrder

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setSortOrder (String sortOrder)
```

<br />

<br />

|          Parameters          ||
|-------------|-----------------|
| `sortOrder` | `String` <br /> |

### setUri

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setUri (Uri uri)
```

<br />

<br />

|     Parameters      ||
|-------|--------------|
| `uri` | `Uri` <br /> |

## Protected methods

### onReset

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onReset ()
```

Subclasses must implement this to take care of resetting their loader, as per[reset()](https://developer.android.com/reference/android/support/v4/content/Loader#reset()). This is not called by clients directly, but as a result of a call to[reset()](https://developer.android.com/reference/android/support/v4/content/Loader#reset()). This will always be called from the process's main thread.

<br />

### onStartLoading

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onStartLoading ()
```

Starts an asynchronous load of the contacts list data. When the result is ready the callbacks will be called on the UI thread. If a previous load has been completed and is still valid the result may be passed to the callbacks immediately. Must be called from the UI thread

<br />

### onStopLoading

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onStopLoading ()
```

Must be called from the UI thread

<br />

-

  ## Interfaces

  - [Loader.OnLoadCanceledListener](https://developer.android.com/reference/android/support/v4/content/Loader.OnLoadCanceledListener)
  - [Loader.OnLoadCompleteListener](https://developer.android.com/reference/android/support/v4/content/Loader.OnLoadCompleteListener)
-

  ## Classes

  - [AsyncTaskLoader](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader)
  - [ContentResolverCompat](https://developer.android.com/reference/android/support/v4/content/ContentResolverCompat)
  - [ContextCompat](https://developer.android.com/reference/android/support/v4/content/ContextCompat)
  - [CursorLoader](https://developer.android.com/reference/android/support/v4/content/CursorLoader)
  - [FileProvider](https://developer.android.com/reference/android/support/v4/content/FileProvider)
  - [IntentCompat](https://developer.android.com/reference/android/support/v4/content/IntentCompat)
  - [Loader](https://developer.android.com/reference/android/support/v4/content/Loader)
  - [Loader.ForceLoadContentObserver](https://developer.android.com/reference/android/support/v4/content/Loader.ForceLoadContentObserver)
  - [LocalBroadcastManager](https://developer.android.com/reference/android/support/v4/content/LocalBroadcastManager)
  - [MimeTypeFilter](https://developer.android.com/reference/android/support/v4/content/MimeTypeFilter)
  - [PermissionChecker](https://developer.android.com/reference/android/support/v4/content/PermissionChecker)
  - [SharedPreferencesCompat](https://developer.android.com/reference/android/support/v4/content/SharedPreferencesCompat)
  - [SharedPreferencesCompat.EditorCompat](https://developer.android.com/reference/android/support/v4/content/SharedPreferencesCompat.EditorCompat)
  - [WakefulBroadcastReceiver](https://developer.android.com/reference/android/support/v4/content/WakefulBroadcastReceiver)