# ContentPager.QueryRunner

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:[Nested Classes](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner#nestedclasses)\|[Methods](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner#pubmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner#)  

# ContentPager.QueryRunner

| 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
static


interface
ContentPager.QueryRunner
`  
`


`

|--------------------------------------------------|
| android.support.content.ContentPager.QueryRunner |

|---|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner#)Known Indirect Subclasses [LoaderQueryRunner](https://developer.android.com/reference/android/support/content/LoaderQueryRunner) |--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [LoaderQueryRunner](https://developer.android.com/reference/android/support/content/LoaderQueryRunner) | 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). | ||

<br />

*** ** * ** ***

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

## Summary

|                                                                                                        ### Nested classes                                                                                                         ||
|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` interface` | [ContentPager.QueryRunner.Callback](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner.Callback) Callback that receives a cursor once a query as been executed on the Runner. |

|                                                                                                                                                                                                                                    ### Public methods                                                                                                                                                                                                                                    ||
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` 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 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`: The query in question. <br /> |

|                         Returns                         ||
|-----------|----------------------------------------------|
| `boolean` | true if the query is already running. <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)