# AsyncTaskLoader

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/AsyncTaskLoader#pubctors)\|[Methods](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#pubmethods)\|[Protected Methods](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#promethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#)  

# AsyncTaskLoader

| 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


abstract
class
AsyncTaskLoader
`  
`


``

extends `[Loader](https://developer.android.com/reference/android/support/v4/content/Loader)`<D>


``


`

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

|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#)Known Direct Subclasses [CursorLoader](https://developer.android.com/reference/android/support/v4/content/CursorLoader) |-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------| | [CursorLoader](https://developer.android.com/reference/android/support/v4/content/CursorLoader) | Static library support version of the framework's[CursorLoader](https://developer.android.com/reference/android/content/CursorLoader.html). | |

<br />

*** ** * ** ***

Static library support version of the framework's[AsyncTaskLoader](https://developer.android.com/reference/android/content/AsyncTaskLoader.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                                                                                                               ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[AsyncTaskLoader](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#AsyncTaskLoader(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context) ` |

|                                                                                                                                                                     ### Public methods                                                                                                                                                                      ||
|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` 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 D` | ` `[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.                                                                                                       |
| ` void`       | ` `[onCanceled](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#onCanceled(D))`(D data) ` Called if the task was canceled before it was completed.                                                                                                                                                        |
| ` void`       | ` `[setUpdateThrottle](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#setUpdateThrottle(long))`(long delayMS) ` Set amount to throttle updates by.                                                                                                                                                       |

|                                                                                                                                          ### Protected methods                                                                                                                                          ||
|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` 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`    | ` `[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()).     |
| ` D`       | ` `[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()).                     |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#)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))`(D 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))`(D 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)`<D> 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)`<D> 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)`<D> 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)`<D> 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/AsyncTaskLoader#)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

### AsyncTaskLoader

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

```
AsyncTaskLoader (Context context)
```

<br />

<br />

|         Parameters          ||
|-----------|------------------|
| `context` | `Context` <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 />

**See also:**

- [loadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#loadInBackground())  

### 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 />                       |

### isLoadInBackgroundCanceled

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

```
boolean isLoadInBackgroundCanceled ()
```

Returns true if the current invocation of[loadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#loadInBackground())is being canceled.

<br />

|                                                                                             Returns                                                                                              ||
|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | True if the current invocation of[loadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#loadInBackground())is being canceled. <br /> |

**See also:**

- [loadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#loadInBackground())  

### loadInBackground

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

```
D 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                    ||
|-----|------------------------------------------|
| `D` | The result of the load operation. <br /> |

|                                                                              Throws                                                                               ||
|------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|
| [OperationCanceledException](https://developer.android.com/reference/android/support/v4/os/OperationCanceledException) | if the load is canceled during execution. |

**See also:**

- [isLoadInBackgroundCanceled()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#isLoadInBackgroundCanceled())
- [cancelLoadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#cancelLoadInBackground())
- [onCanceled(D)](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#onCanceled(D))  

### onCanceled

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

```
void onCanceled (D data)
```

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                                                                                                                                                            ||
|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `data` | `D`: The value that was returned by[loadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#loadInBackground()), or null if the task threw[OperationCanceledException](https://developer.android.com/reference/android/support/v4/os/OperationCanceledException). <br /> |

### setUpdateThrottle

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

```
void setUpdateThrottle (long delayMS)
```

Set amount to throttle updates by. This is the minimum time from when the last[loadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#loadInBackground())call has completed until a new load is scheduled.

<br />

|                         Parameters                          ||
|-----------|--------------------------------------------------|
| `delayMS` | `long`: Amount of delay, in milliseconds. <br /> |

## Protected methods

### onCancelLoad

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

```
boolean onCancelLoad ()
```

Subclasses must implement this to take care of requests to[cancelLoad()](https://developer.android.com/reference/android/support/v4/content/Loader#cancelLoad()). This will always be called from the process's main thread.

<br />

|                                                                                                                                                                                                                                                      Returns                                                                                                                                                                                                                                                       ||
|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | Returnsfalseif the task could not be canceled, typically because it has already completed normally, or because[startLoading()](https://developer.android.com/reference/android/support/v4/content/Loader#startLoading())hasn't been called; returnstrueotherwise. Whentrueis returned, the task is still running and the[Loader.OnLoadCanceledListener](https://developer.android.com/reference/android/support/v4/content/Loader.OnLoadCanceledListener)will be called when the task completes. <br /> |

### onForceLoad

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

```
void onForceLoad ()
```

Subclasses must implement this to take care of requests to[forceLoad()](https://developer.android.com/reference/android/support/v4/content/Loader#forceLoad()). This will always be called from the process's main thread.

<br />

### onLoadInBackground

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

```
D onLoadInBackground ()
```

Calls[loadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#loadInBackground()). This method is reserved for use by the loader framework. Subclasses should override[loadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#loadInBackground())instead of this method.

<br />

|                    Returns                    ||
|-----|------------------------------------------|
| `D` | The result of the load operation. <br /> |

|                                                                              Throws                                                                               ||
|------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|
| [OperationCanceledException](https://developer.android.com/reference/android/support/v4/os/OperationCanceledException) | if the load is canceled during execution. |

**See also:**

- [loadInBackground()](https://developer.android.com/reference/android/support/v4/content/AsyncTaskLoader#loadInBackground())  
-

  ## 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)