CursorLoader
open classCursorLoader: AsyncTaskLoader<Cursor!>
| kotlin.Any | |||
| ↳ | android.content.Loader<D> | ||
| ↳ | android.content.AsyncTaskLoader<android.database.Cursor> | ||
| ↳ | android.content.CursorLoader | ||
A loader that queries the ContentResolver and returns a Cursor. This class implements the Loader protocol in a standard way for querying cursors, building on AsyncTaskLoader to perform the cursor query on a background thread so that it does not block the application's UI.
A CursorLoader must be built with the full information for the query to perform, either through the CursorLoader(android.content.Context,android.net.Uri,java.lang.String[],java.lang.String,java.lang.String[],java.lang.String) or creating an empty instance with CursorLoader(android.content.Context) and filling in the desired parameters with setUri(android.net.Uri), setSelection(java.lang.String), setSelectionArgs(java.lang.String[]), setSortOrder(java.lang.String), and setProjection(java.lang.String[]).
Summary
| Public constructors | |
|---|---|
CursorLoader(context: Context!)Creates an empty unspecified CursorLoader. |
|
CursorLoader(context: Context!, uri: Uri!, projection: Array<String!>!, selection: String!, selectionArgs: Array<String!>!, sortOrder: String!)Creates a fully-specified CursorLoader. |
|
| Public methods | |
|---|---|
| open Unit | |
| open Unit |
deliverResult(cursor: Cursor!) |
| open Unit |
dump(prefix: String!, fd: FileDescriptor!, writer: PrintWriter!, args: Array<String!>!) |
| open Array<String!>! | |
| open String! | |
| open Array<String!>! | |
| open String! | |
| open Uri! |
getUri() |
| open Cursor! | |
| open Unit |
onCanceled(cursor: Cursor!) |
| open Unit |
setProjection(projection: Array<String!>!) |
| open Unit |
setSelection(selection: String!) |
| open Unit |
setSelectionArgs(selectionArgs: Array<String!>!) |
| open Unit |
setSortOrder(sortOrder: String!) |
| open Unit | |
| Protected methods | |
|---|---|
| open Unit |
onReset() |
| open Unit |
Starts an asynchronous load of the data. |
| open Unit |
Must be called from the UI thread |
| Inherited functions | |
|---|---|
Public constructors
CursorLoader
CursorLoader(context: Context!)
Creates an empty unspecified CursorLoader. You must follow this with calls to setUri(android.net.Uri), setSelection(java.lang.String), etc to specify the query to perform.
CursorLoader
CursorLoader(
context: Context!,
uri: Uri!,
projection: Array<String!>!,
selection: String!,
selectionArgs: Array<String!>!,
sortOrder: String!)
Creates a fully-specified CursorLoader. See ContentResolver.query() for documentation on the meaning of the parameters. These will be passed as-is to that call.
Public methods
deliverResult
open fundeliverResult(cursor: Cursor!): Unit
Deprecated: Deprecated in Java.
| Parameters | |
|---|---|
data |
the result of the load |
dump
open fundump(
prefix: String!,
fd: FileDescriptor!,
writer: PrintWriter!,
args: Array<String!>!
): Unit
Deprecated: Deprecated in Java.
| Parameters | |
|---|---|
prefix |
String!: Text to print at the front of each line. |
fd |
FileDescriptor!: The raw file descriptor that the dump is being sent to. |
writer |
PrintWriter!: A PrintWriter to which the dump is to be set. |
args |
Array<String!>!: Additional arguments to the dump request. |
getProjection
open fungetProjection(): Array<String!>!
Deprecated: Deprecated in Java.
getSelectionArgs
open fungetSelectionArgs(): Array<String!>!
Deprecated: Deprecated in Java.
loadInBackground
open funloadInBackground(): Cursor!
Deprecated: Deprecated in Java.
| Return | |
|---|---|
Cursor! |
The result of the load operation. |
| Exceptions | |
|---|---|
android.os.OperationCanceledException |
if the load is canceled during execution. |
onCanceled
open funonCanceled(cursor: Cursor!): Unit
Deprecated: Deprecated in Java.
| Parameters | |
|---|---|
data |
The value that was returned by loadInBackground, or null if the task threw OperationCanceledException. |
setProjection
open funsetProjection(projection: Array<String!>!): Unit
Deprecated: Deprecated in Java.
setSelection
open funsetSelection(selection: String!): Unit
Deprecated: Deprecated in Java.
setSelectionArgs
open funsetSelectionArgs(selectionArgs: Array<String!>!): Unit
Deprecated: Deprecated in Java.
setSortOrder
open funsetSortOrder(sortOrder: String!): Unit
Deprecated: Deprecated in Java.
Protected methods
onStartLoading
protected open funonStartLoading(): Unit
Deprecated: Deprecated in Java.
Starts an asynchronous load of the 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
onStopLoading
protected open funonStopLoading(): Unit
Deprecated: Deprecated in Java.
Must be called from the UI thread