java.lang.Object | ||
↳ | android.support.v4.content.Loader<D> | |
↳ | android.support.v4.content.AsyncTaskLoader<D> |
Known Direct Subclasses |
Static library support version of the framework's AsyncTaskLoader
.
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.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called on the main thread to abort a load in progress.
| |||||||||||
Print the Loader's state into the given stream.
| |||||||||||
Returns true if the current invocation of
loadInBackground() is being canceled.
| |||||||||||
Called on a worker thread to perform the actual load and to return
the result of the load operation.
| |||||||||||
Called if the task was canceled before it was completed.
| |||||||||||
Set amount to throttle updates by.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Subclasses must implement this to take care of requests to
cancelLoad() .
| |||||||||||
Subclasses must implement this to take care of requests to
forceLoad() .
| |||||||||||
Calls
loadInBackground() .
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.support.v4.content.Loader
| |||||||||||
From class
java.lang.Object
|
Called on the main thread to abort a load in progress.
Override this method to abort the current invocation of loadInBackground()
that is running in the background on a worker thread.
This method should do nothing if loadInBackground()
has not started
running or if it has already finished.
Print the Loader's state into the given stream.
prefix | Text to print at the front of each line. |
---|---|
fd | The raw file descriptor that the dump is being sent to. |
writer | A PrintWriter to which the dump is to be set. |
args | Additional arguments to the dump request. |
Returns true if the current invocation of loadInBackground()
is being canceled.
loadInBackground()
is being canceled.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)
on
the UI thread. If implementations need to process the results on the UI thread
they may override deliverResult(D)
and do so there.
To support cancellation, this method should periodically check the value of
isLoadInBackgroundCanceled()
and terminate when it returns true.
Subclasses may also override cancelLoadInBackground()
to interrupt the load
directly instead of polling isLoadInBackgroundCanceled()
.
When the load is canceled, this method may either return normally or throw
OperationCanceledException
. In either case, the Loader
will
call onCanceled(D)
to perform post-cancellation cleanup and to dispose of the
result object, if any.
OperationCanceledException | if the load is canceled during execution. |
---|
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.
data | The value that was returned by loadInBackground() , or null
if the task threw OperationCanceledException .
|
---|
Set amount to throttle updates by. This is the minimum time from
when the last loadInBackground()
call has completed until
a new load is scheduled.
delayMS | Amount of delay, in milliseconds. |
---|
Subclasses must implement this to take care of requests to cancelLoad()
.
This will always be called from the process's main thread.
startLoading()
hasn't been called; returns
true otherwise. When true is returned, the task
is still running and the Loader.OnLoadCanceledListener
will be called
when the task completes.
Subclasses must implement this to take care of requests to forceLoad()
.
This will always be called from the process's main thread.
Calls loadInBackground()
.
This method is reserved for use by the loader framework.
Subclasses should override loadInBackground()
instead of this method.
OperationCanceledException | if the load is canceled during execution. |
---|