# ContentPager.QueryRunner.Callback

Artifact: [androidx.contentpager:contentpager](https://developer.android.com/jetpack/androidx/releases/contentpager) [View Source](https://cs.android.com/search?q=file:androidx/contentpager/content/ContentPager.java+class:androidx.contentpager.content.ContentPager.QueryRunner.Callback) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/contentpager#1.0.0)

*** ** * ** ***


```
public interface ContentPager.QueryRunner.Callback
```

<br />

*** ** * ** ***

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

## Summary

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

## Public methods

### onQueryFinished

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/contentpager#1.0.0)

```
abstract void onQueryFinished(@NonNull Query query, @Nullable Cursor cursor)
```

Called on main thread when query has completed.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/contentpager/content/Query query` | The completed query. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/database/Cursor.html cursor` | The results in Cursor form. Null if not successfully completed. |

### runQueryInBackground

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/contentpager#1.0.0)

```
abstract @Nullable Cursor runQueryInBackground(@NonNull Query query)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/contentpager/content/Query query` | The query to be executed. |