LoaderQueryRunner
public final class LoaderQueryRunner implements 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( |
Public methods |
|
|---|---|
void |
Attempt to cancel a (presumably) running query. |
boolean |
|
void |
query(Execute a query. |
Public constructors
LoaderQueryRunner
public LoaderQueryRunner(
@NonNull Context context,
@NonNull LoaderManager loaderMgr
)
Public methods
cancel
public void cancel(@NonNull Query query)
Attempt to cancel a (presumably) running query.
isRunning
public boolean isRunning(@NonNull Query query)
| Returns | |
|---|---|
boolean |
true if the query is already running. |
query
public void query(
@NonNull Query query,
@NonNull ContentPager.QueryRunner.Callback callback
)
Execute a query.
| Parameters | |
|---|---|
@NonNull Query query |
The query that will be run. This value should be handed back to the callback when ready to run in the background. |
@NonNull ContentPager.QueryRunner.Callback callback |
The callback that should be called to both execute the query (in the background) and to receive the results (in the foreground). |