public class PhotoPagerLoader extends CursorLoader
Loader.ForceLoadContentObserver, Loader.OnLoadCanceledListener<D>, Loader.OnLoadCompleteListener<D>
Constructor and Description |
---|
PhotoPagerLoader(Context context,
Uri photosUri,
String[] projection) |
Modifier and Type | Method and Description |
---|---|
Cursor |
loadInBackground()
Called on a worker thread to perform the actual load and to return
the result of the load operation.
|
cancelLoadInBackground, deliverResult, dump, getProjection, getSelection, getSelectionArgs, getSortOrder, getUri, onCanceled, onReset, onStartLoading, onStopLoading, setProjection, setSelection, setSelectionArgs, setSortOrder, setUri
isLoadInBackgroundCanceled, onCancelLoad, onForceLoad, onLoadInBackground, setUpdateThrottle, waitForLoader
abandon, cancelLoad, commitContentChanged, dataToString, deliverCancellation, forceLoad, getContext, getId, isAbandoned, isReset, isStarted, onAbandon, onContentChanged, registerListener, registerOnLoadCanceledListener, reset, rollbackContentChanged, startLoading, stopLoading, takeContentChanged, toString, unregisterListener, unregisterOnLoadCanceledListener
public Cursor loadInBackground()
AsyncTaskLoader
Loader.deliverResult(D)
on
the UI thread. If implementations need to process the results on the UI thread
they may override Loader.deliverResult(D)
and do so there.
To support cancellation, this method should periodically check the value of
AsyncTaskLoader.isLoadInBackgroundCanceled()
and terminate when it returns true.
Subclasses may also override AsyncTaskLoader.cancelLoadInBackground()
to interrupt the load
directly instead of polling AsyncTaskLoader.isLoadInBackgroundCanceled()
.
When the load is canceled, this method may either return normally or throw
OperationCanceledException
. In either case, the Loader
will
call AsyncTaskLoader.onCanceled(D)
to perform post-cancellation cleanup and to dispose of the
result object, if any.loadInBackground
in class CursorLoader
AsyncTaskLoader.isLoadInBackgroundCanceled()
,
AsyncTaskLoader.cancelLoadInBackground()
,
AsyncTaskLoader.onCanceled(D)