|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.support.v4.content.Loader<D>
android.support.v4.content.AsyncTaskLoader<Cursor>
android.support.v4.content.CursorLoader
public class CursorLoader
Static library support version of the framework's android.content.CursorLoader
.
Used to write apps that run on platforms prior to Android 3.0. When running
on Android 3.0 or above, this implementation is still used; it does not try
to switch to the framework's implementation. See the framework SDK
documentation for a class overview.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class android.support.v4.content.Loader |
---|
Loader.ForceLoadContentObserver, Loader.OnLoadCompleteListener<D> |
Constructor Summary | |
---|---|
CursorLoader(Context context)
Creates an empty unspecified CursorLoader. |
|
CursorLoader(Context context,
Uri uri,
java.lang.String[] projection,
java.lang.String selection,
java.lang.String[] selectionArgs,
java.lang.String sortOrder)
Creates a fully-specified CursorLoader. |
Method Summary | |
---|---|
void |
deliverResult(Cursor cursor)
Sends the result of the load to the registered listener. |
void |
dump(java.lang.String prefix,
java.io.FileDescriptor fd,
java.io.PrintWriter writer,
java.lang.String[] args)
Print the Loader's state into the given stream. |
java.lang.String[] |
getProjection()
|
java.lang.String |
getSelection()
|
java.lang.String[] |
getSelectionArgs()
|
java.lang.String |
getSortOrder()
|
Uri |
getUri()
|
Cursor |
loadInBackground()
|
void |
onCanceled(Cursor cursor)
Called if the task was canceled before it was completed. |
protected void |
onReset()
Subclasses must implement this to take care of resetting their loader, as per Loader.reset() . |
protected void |
onStartLoading()
Starts an asynchronous load of the contacts list data. |
protected void |
onStopLoading()
Must be called from the UI thread |
void |
setProjection(java.lang.String[] projection)
|
void |
setSelection(java.lang.String selection)
|
void |
setSelectionArgs(java.lang.String[] selectionArgs)
|
void |
setSortOrder(java.lang.String sortOrder)
|
void |
setUri(Uri uri)
|
Methods inherited from class android.support.v4.content.AsyncTaskLoader |
---|
cancelLoad, onForceLoad, onLoadInBackground, setUpdateThrottle, waitForLoader |
Methods inherited from class android.support.v4.content.Loader |
---|
abandon, dataToString, forceLoad, getContext, getId, isAbandoned, isReset, isStarted, onAbandon, onContentChanged, registerListener, reset, startLoading, stopLoading, takeContentChanged, toString, unregisterListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CursorLoader(Context context)
setUri(Uri)
, setSelection(String)
, etc
to specify the query to perform.
public CursorLoader(Context context, Uri uri, java.lang.String[] projection, java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String sortOrder)
ContentResolver.query()
for documentation on the meaning of the
parameters. These will be passed as-is to that call.
Method Detail |
---|
public Cursor loadInBackground()
loadInBackground
in class AsyncTaskLoader<Cursor>
public void deliverResult(Cursor cursor)
Loader
deliverResult
in class Loader<Cursor>
cursor
- the result of the loadprotected void onStartLoading()
onStartLoading
in class Loader<Cursor>
protected void onStopLoading()
onStopLoading
in class Loader<Cursor>
public void onCanceled(Cursor cursor)
AsyncTaskLoader
onCanceled
in class AsyncTaskLoader<Cursor>
protected void onReset()
Loader
Loader.reset()
. This is not called by clients directly,
but as a result of a call to Loader.reset()
.
This will always be called from the process's main thread.
onReset
in class Loader<Cursor>
public Uri getUri()
public void setUri(Uri uri)
public java.lang.String[] getProjection()
public void setProjection(java.lang.String[] projection)
public java.lang.String getSelection()
public void setSelection(java.lang.String selection)
public java.lang.String[] getSelectionArgs()
public void setSelectionArgs(java.lang.String[] selectionArgs)
public java.lang.String getSortOrder()
public void setSortOrder(java.lang.String sortOrder)
public void dump(java.lang.String prefix, java.io.FileDescriptor fd, java.io.PrintWriter writer, java.lang.String[] args)
Loader
dump
in class AsyncTaskLoader<Cursor>
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |