Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# ContentPager.QueryRunner.Callback\n\nadded in [version 27.1.0](/topic/libraries/support-library/revisions) \nbelongs to Maven artifact com.android.support:support-content:28.0.0-alpha1 \n\nContentPager.QueryRunner.Callback\n=================================\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class\n| mappings](/jetpack/androidx/migrate/class-mappings).\n\n\n`\npublic\nstatic\n\n\ninterface\nContentPager.QueryRunner.Callback\n`\n\n\n`\n\n\n`\n\n|-----------------------------------------------------------|\n| android.support.content.ContentPager.QueryRunner.Callback |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nCallback that receives a cursor once a query as been executed on the Runner.\n\nSummary\n-------\n\n| ### Public methods ||\n|--------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onQueryFinished](/reference/android/support/content/ContentPager.QueryRunner.Callback#onQueryFinished(android.support.content.Query, android.database.Cursor))`(`[Query](/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. |\n| ` abstract `[Cursor](https://developer.android.com/reference/android/database/Cursor.html) | ` `[runQueryInBackground](/reference/android/support/content/ContentPager.QueryRunner.Callback#runQueryInBackground(android.support.content.Query))`(`[Query](/reference/android/support/content/Query)` query) ` Method called on background thread where actual query is executed. |\n\nPublic methods\n--------------\n\n### onQueryFinished\n\nadded in [version 27.1.0](/topic/libraries/support-library/revisions) \n\n```\nvoid onQueryFinished (Query query, \n Cursor cursor)\n```\n\nCalled on main thread when query has completed.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|----------------------------------------------------------------------------------|\n| `query` | `Query`: The completed query. \u003cbr /\u003e |\n| `cursor` | `Cursor`: The results in Cursor form. Null if not successfully completed. \u003cbr /\u003e |\n\n### runQueryInBackground\n\nadded in [version 27.1.0](/topic/libraries/support-library/revisions) \n\n```\nCursor runQueryInBackground (Query query)\n```\n\nMethod called on background thread where actual query is executed. This is provided\nby ContentPager.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|-------------------------------------------|\n| `query` | `Query`: The query to be executed. \u003cbr /\u003e |\n\n| Returns ||\n|--------------------------------------------------------------------------------|--------|\n| [Cursor](https://developer.android.com/reference/android/database/Cursor.html) | \u003cbr /\u003e |\n\n-\n\n Annotations\n -----------\n\n - [ContentPager.CursorDisposition](/reference/android/support/content/ContentPager.CursorDisposition)\n-\n\n Interfaces\n ----------\n\n - [ContentPager.ContentCallback](/reference/android/support/content/ContentPager.ContentCallback)\n - [ContentPager.QueryRunner](/reference/android/support/content/ContentPager.QueryRunner)\n - [ContentPager.QueryRunner.Callback](/reference/android/support/content/ContentPager.QueryRunner.Callback)\n-\n\n Classes\n -------\n\n - [ContentPager](/reference/android/support/content/ContentPager)\n - [LoaderQueryRunner](/reference/android/support/content/LoaderQueryRunner)\n - [Query](/reference/android/support/content/Query)\n - [R](/reference/android/support/content/R)\n - [R.attr](/reference/android/support/content/R.attr)\n - [R.bool](/reference/android/support/content/R.bool)\n - [R.color](/reference/android/support/content/R.color)\n - [R.dimen](/reference/android/support/content/R.dimen)\n - [R.drawable](/reference/android/support/content/R.drawable)\n - [R.id](/reference/android/support/content/R.id)\n - [R.integer](/reference/android/support/content/R.integer)\n - [R.layout](/reference/android/support/content/R.layout)\n - [R.string](/reference/android/support/content/R.string)\n - [R.style](/reference/android/support/content/R.style)\n - [R.styleable](/reference/android/support/content/R.styleable)"]]