# ContentPager.QueryRunner.Callback

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  

# ContentPager.QueryRunner.Callback

| 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.Callback
`  
`


`

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

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                                                                                                                                       ### Public methods                                                                                                                                                                                                                                                        ||
|--------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void`                                                                           | ` `[onQueryFinished](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner.Callback#onQueryFinished(android.support.content.Query, android.database.Cursor))`(`[Query](https://developer.android.com/reference/android/support/content/Query)` query, `[Cursor](https://developer.android.com/reference/android/database/Cursor.html)` cursor) ` Called on main thread when query has completed. |
| ` abstract `[Cursor](https://developer.android.com/reference/android/database/Cursor.html) | ` `[runQueryInBackground](https://developer.android.com/reference/android/support/content/ContentPager.QueryRunner.Callback#runQueryInBackground(android.support.content.Query))`(`[Query](https://developer.android.com/reference/android/support/content/Query)` query) ` Method called on background thread where actual query is executed.                                                                                      |

## Public methods

### onQueryFinished

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

```
void onQueryFinished (Query query, 
                Cursor cursor)
```

Called on main thread when query has completed.

<br />

|                                         Parameters                                         ||
|----------|----------------------------------------------------------------------------------|
| `query`  | `Query`: The completed query. <br />                                             |
| `cursor` | `Cursor`: The results in Cursor form. Null if not successfully completed. <br /> |

### runQueryInBackground

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

```
Cursor runQueryInBackground (Query query)
```

Method called on background thread where actual query is executed. This is provided by ContentPager.

<br />

|                     Parameters                     ||
|---------|-------------------------------------------|
| `query` | `Query`: The query to be executed. <br /> |

|                                        Returns                                         ||
|--------------------------------------------------------------------------------|--------|
| [Cursor](https://developer.android.com/reference/android/database/Cursor.html) | <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)