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,["# Query\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 \nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \\| [\\[Expand All\\]](#) \n\nQuery\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\n\nfinal\n\nclass\nQuery\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|-------------------------------|\n| java.lang.Object ||\n| ↳ | android.support.content.Query |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nEncapsulates information related to calling [query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentResolver.html#query(android.net.Uri, java.lang.String[], android.os.Bundle, android.os.CancellationSignal)),\nincluding the logic determining the best query method to call.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|\n| ` boolean` | ` `[equals](/reference/android/support/content/Query#equals(java.lang.Object))`(Object obj) ` |\n| ` int` | ` `[getId](/reference/android/support/content/Query#getId())`() ` |\n| ` int` | ` `[getLimit](/reference/android/support/content/Query#getLimit())`() ` |\n| ` int` | ` `[getOffset](/reference/android/support/content/Query#getOffset())`() ` |\n| ` `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[getUri](/reference/android/support/content/Query#getUri())`() ` |\n| ` int` | ` `[hashCode](/reference/android/support/content/Query#hashCode())`() ` |\n| ` String` | ` `[toString](/reference/android/support/content/Query#toString())`() ` |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` 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() ` | ||\n\nPublic methods\n--------------\n\n### equals\n\n```\nboolean equals (Object obj)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------|-----------------|\n| `obj` | `Object` \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------|\n| `boolean` | \u003cbr /\u003e |\n\n### getId\n\nadded in [version 27.1.0](/topic/libraries/support-library/revisions) \n\n```\nint getId ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|-----------------------------------------------------------------------------|\n| `int` | the id for this query. Derived from Uri as well as paging arguments. \u003cbr /\u003e |\n\n### getLimit\n\nadded in [version 27.1.0](/topic/libraries/support-library/revisions) \n\n```\nint getLimit ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|-------------------|\n| `int` | the limit. \u003cbr /\u003e |\n\n### getOffset\n\nadded in [version 27.1.0](/topic/libraries/support-library/revisions) \n\n```\nint getOffset ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------------------|\n| `int` | the offset. \u003cbr /\u003e |\n\n### getUri\n\nadded in [version 27.1.0](/topic/libraries/support-library/revisions) \n\n```\nUri getUri ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------------------------------------|-----------------|\n| [Uri](https://developer.android.com/reference/android/net/Uri.html) | the Uri. \u003cbr /\u003e |\n\n### hashCode\n\n```\nint hashCode ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### toString\n\n```\nString toString ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|----------|--------|\n| `String` | \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)"]]