CursorLoader

open class CursorLoader : AsyncTaskLoader<Cursor!>
kotlin.Any
   ↳ androidx.loader.content.Loader<D>
   ↳ androidx.loader.content.AsyncTaskLoader<android.database.Cursor>
   ↳ androidx.loader.content.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.

Summary

Public constructors

<init>(@NonNull context: Context)

Creates an empty unspecified CursorLoader.

<init>(@NonNull context: Context, @NonNull uri: Uri, @Nullable projection: Array<String!>?, @Nullable selection: String?, @Nullable selectionArgs: Array<String!>?, @Nullable sortOrder: String?)

Creates a fully-specified CursorLoader.

Public methods

open Unit

open Unit

open Unit
dump(prefix: String!, fd: FileDescriptor!, writer: PrintWriter!, args: Array<String!>!)

open Array<String!>?

open String?

open Array<String!>?

open String?

open Uri

open Cursor?

open Unit
onCanceled(cursor: Cursor?)

open Unit
setProjection(@Nullable projection: Array<String!>?)

open Unit
setSelection(@Nullable selection: String?)

open Unit
setSelectionArgs(@Nullable selectionArgs: Array<String!>?)

open Unit
setSortOrder(@Nullable sortOrder: String?)

open Unit
setUri(@NonNull uri: Uri)

Protected methods

open Unit

open Unit

Starts an asynchronous load of the contacts list data.

open Unit

Must be called from the UI thread

Inherited functions

Public constructors

<init>

CursorLoader(@NonNull context: Context)

Creates an empty unspecified CursorLoader. You must follow this with calls to setUri(Uri), setSelection(String), etc to specify the query to perform.

<init>

CursorLoader(@NonNull context: Context, @NonNull uri: Uri, @Nullable projection: Array<String!>?, @Nullable selection: String?, @Nullable selectionArgs: Array<String!>?, @Nullable 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

cancelLoadInBackground

open fun cancelLoadInBackground(): Unit

deliverResult

open fun deliverResult(cursor: Cursor?): Unit

dump

open fun dump(prefix: String!, fd: FileDescriptor!, writer: PrintWriter!, args: Array<String!>!): Unit

Deprecated: Consider using LoaderManager#enableDebugLogging(boolean) to understand the series of operations performed by LoaderManager.

Parameters
prefix String!: Text to print at the front of each line.
fd String!: The raw file descriptor that the dump is being sent to.
writer String!: A PrintWriter to which the dump is to be set.
args String!: Additional arguments to the dump request.

getProjection

@Nullable open fun getProjection(): Array<String!>?

getSelection

@Nullable open fun getSelection(): String?

getSelectionArgs

@Nullable open fun getSelectionArgs(): Array<String!>?

getSortOrder

@Nullable open fun getSortOrder(): String?

getUri

@NonNull open fun getUri(): Uri

loadInBackground

open fun loadInBackground(): Cursor?

onCanceled

open fun onCanceled(cursor: Cursor?): Unit

setProjection

open fun setProjection(@Nullable projection: Array<String!>?): Unit

setSelection

open fun setSelection(@Nullable selection: String?): Unit

setSelectionArgs

open fun setSelectionArgs(@Nullable selectionArgs: Array<String!>?): Unit

setSortOrder

open fun setSortOrder(@Nullable sortOrder: String?): Unit

setUri

open fun setUri(@NonNull uri: Uri): Unit

Protected methods

onReset

protected open fun onReset(): Unit

onStartLoading

protected open fun onStartLoading(): Unit

Starts an asynchronous load of the contacts list 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 fun onStopLoading(): Unit

Must be called from the UI thread