Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

QueryRunner

interface QueryRunner
androidx.contentpager.content.ContentPager.QueryRunner

Implementations of this interface provide the mechanism for execution of queries off the UI thread.

Summary

Nested classes

abstract

Callback that receives a cursor once a query as been executed on the Runner.

Public methods

abstract Unit
cancel(@NonNull query: Query)

Attempt to cancel a (presumably) running query.

abstract Boolean
isRunning(@NonNull query: Query)

abstract Unit
query(@NonNull query: Query, @NonNull callback: ContentPager.QueryRunner.Callback)

Execute a query.

Public methods

cancel

abstract fun cancel(@NonNull query: Query): Unit

Attempt to cancel a (presumably) running query.

Parameters
query Query: The query in question.

isRunning

abstract fun isRunning(@NonNull query: Query): Boolean
Parameters
query Query: The query in question.
Return
Boolean: true if the query is already running.

query

abstract fun query(@NonNull query: Query, @NonNull 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 Query: The callback that should be called to both execute the query (in the background) and to receive the results (in the foreground).