# LoaderQueryRunner

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-content:28.0.0-alpha1  
Summary:[Ctors](https://developer.android.com/reference/android/support/content/LoaderQueryRunner#pubctors)\|[Methods](https://developer.android.com/reference/android/support/content/LoaderQueryRunner#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/content/LoaderQueryRunner#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/content/LoaderQueryRunner#)  

# LoaderQueryRunner

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public

final

class
LoaderQueryRunner
`  
`

extends Object


``


implements

`[ContentPager.QueryRunner](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner)`


`

|---|-------------------------------------------|
| java.lang.Object                             ||
| ↳ | android.support.content.LoaderQueryRunner |

<br />

*** ** * ** ***

A[ContentPager.QueryRunner](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner)that executes queries using a[LoaderManager](https://developer.android.com/reference/android/app/LoaderManager.html). Use this when preparing[ContentPager](https://developer.android.com/reference/android/support/content/ContentPager)to run in an Activity or Fragment scope.

## Summary

|                                                                                                                                                                                ### Public constructors                                                                                                                                                                                ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[LoaderQueryRunner](https://developer.android.com/reference/android/support/content/LoaderQueryRunner#LoaderQueryRunner(android.content.Context, android.app.LoaderManager))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, `[LoaderManager](https://developer.android.com/reference/android/app/LoaderManager.html)` loaderMgr) ` |

|                                                                                                                                                                                                                            ### Public methods                                                                                                                                                                                                                            ||
|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`    | ` `[cancel](https://developer.android.com/reference/android/support/content/LoaderQueryRunner#cancel(android.support.content.Query))`(`[Query](https://developer.android.com/reference/android/support/content/Query)` query) ` Attempt to cancel a (presumably) running query.                                                                                                                                                                              |
| ` boolean` | ` `[isRunning](https://developer.android.com/reference/android/support/content/LoaderQueryRunner#isRunning(android.support.content.Query))`(`[Query](https://developer.android.com/reference/android/support/content/Query)` query) `                                                                                                                                                                                                                        |
| ` void`    | ` `[query](https://developer.android.com/reference/android/support/content/LoaderQueryRunner#query(android.support.content.Query, android.support.content.ContentPager.QueryRunner.Callback))`(`[Query](https://developer.android.com/reference/android/support/content/Query)` query, `[ContentPager.QueryRunner.Callback](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner.Callback)` callback) ` Execute a query. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/content/LoaderQueryRunner#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/content/LoaderQueryRunner#)From interface` `[android.support.content.ContentPager.QueryRunner](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner)` ` |---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void`    | ` `[cancel](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner#cancel(android.support.content.Query))`(`[Query](https://developer.android.com/reference/android/support/content/Query)` query) ` Attempt to cancel a (presumably) running query.                                                                                                                                                                              | | ` abstract boolean` | ` `[isRunning](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner#isRunning(android.support.content.Query))`(`[Query](https://developer.android.com/reference/android/support/content/Query)` query) `                                                                                                                                                                                                                        | | ` abstract void`    | ` `[query](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner#query(android.support.content.Query, android.support.content.ContentPager.QueryRunner.Callback))`(`[Query](https://developer.android.com/reference/android/support/content/Query)` query, `[ContentPager.QueryRunner.Callback](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner.Callback)` callback) ` Execute a query. | ||

## Public constructors

### LoaderQueryRunner

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
LoaderQueryRunner (Context context, 
                LoaderManager loaderMgr)
```

<br />

<br />

|             Parameters              ||
|-------------|------------------------|
| `context`   | `Context` <br />       |
| `loaderMgr` | `LoaderManager` <br /> |

## Public methods

### cancel

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void cancel (Query query)
```

Attempt to cancel a (presumably) running query.

<br />

|                   Parameters                    ||
|---------|----------------------------------------|
| `query` | `Query`: The query in question. <br /> |

### isRunning

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isRunning (Query query)
```

<br />

<br />

|       Parameters        ||
|---------|----------------|
| `query` | `Query` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### query

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void query (Query query, 
                ContentPager.QueryRunner.Callback callback)
```

Execute a query.

<br />

|                                                                                        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. <br />                                            |
| `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). <br /> |

-

  ## Annotations

  - [ContentPager.CursorDisposition](https://developer.android.com/reference/android/support/content/ContentPager.CursorDisposition)
-

  ## Interfaces

  - [ContentPager.ContentCallback](https://developer.android.com/reference/android/support/content/ContentPager.ContentCallback)
  - [ContentPager.QueryRunner](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner)
  - [ContentPager.QueryRunner.Callback](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner.Callback)
-

  ## Classes

  - [ContentPager](https://developer.android.com/reference/android/support/content/ContentPager)
  - [LoaderQueryRunner](https://developer.android.com/reference/android/support/content/LoaderQueryRunner)
  - [Query](https://developer.android.com/reference/android/support/content/Query)
  - [R](https://developer.android.com/reference/android/support/content/R)
  - [R.attr](https://developer.android.com/reference/android/support/content/R.attr)
  - [R.bool](https://developer.android.com/reference/android/support/content/R.bool)
  - [R.color](https://developer.android.com/reference/android/support/content/R.color)
  - [R.dimen](https://developer.android.com/reference/android/support/content/R.dimen)
  - [R.drawable](https://developer.android.com/reference/android/support/content/R.drawable)
  - [R.id](https://developer.android.com/reference/android/support/content/R.id)
  - [R.integer](https://developer.android.com/reference/android/support/content/R.integer)
  - [R.layout](https://developer.android.com/reference/android/support/content/R.layout)
  - [R.string](https://developer.android.com/reference/android/support/content/R.string)
  - [R.style](https://developer.android.com/reference/android/support/content/R.style)
  - [R.styleable](https://developer.android.com/reference/android/support/content/R.styleable)