LoaderQueryRunner


class LoaderQueryRunner : ContentPager.QueryRunner


A ContentPager.QueryRunner that executes queries using a LoaderManager. Use this when preparing ContentPager to run in an Activity or Fragment scope.

Summary

Public constructors

LoaderQueryRunner(context: Context, loaderMgr: LoaderManager)

Public functions

Unit
cancel(query: Query)

Attempt to cancel a (presumably) running query.

Boolean
isRunning(query: Query)
Unit

Execute a query.

Public constructors

LoaderQueryRunner

Added in 1.0.0
LoaderQueryRunner(context: Context, loaderMgr: LoaderManager)

Public functions

cancel

Added in 1.1.0-alpha01
fun cancel(query: Query): Unit

Attempt to cancel a (presumably) running query.

Parameters
query: Query

The query in question.

isRunning

Added in 1.1.0-alpha01
fun isRunning(query: Query): Boolean
Parameters
query: Query

The query in question.

Returns
Boolean

true if the query is already running.

query

Added in 1.1.0-alpha01
fun query(query: Query, callback: ContentPager.QueryRunner.Callback): Unit

Execute a query.

Parameters
query: Query

The query that will be run. This value should be handed back to the callback when ready to run in the background.

callback: ContentPager.QueryRunner.Callback

The callback that should be called to both execute the query (in the background) and to receive the results (in the foreground).