# ContentResolver

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/content/ContentResolver#nestedclasses)\|[Constants](https://developer.android.com/reference/android/content/ContentResolver#constants)\|[Ctors](https://developer.android.com/reference/android/content/ContentResolver#pubctors)\|[Methods](https://developer.android.com/reference/android/content/ContentResolver#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/content/ContentResolver#inhmethods)  

# ContentResolver

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/content/ContentResolver "View this page in Kotlin")\|Java

`
public


abstract
class
ContentResolver
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|---------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.content.ContentResolver |

|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known direct subclasses [MockContentResolver](https://developer.android.com/reference/android/test/mock/MockContentResolver) |------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------| | [MockContentResolver](https://developer.android.com/reference/android/test/mock/MockContentResolver) | An extension of[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)that is designed for testing. | |

<br />

*** ** * ** ***

This class provides applications access to the content model.  

### Developer Guides

For more information about using a ContentResolver with content providers, read the[Content Providers](https://developer.android.com/guide/topics/providers/content-providers)developer guide.

<br />

## Summary

|                                                                                                        ### Nested classes                                                                                                        ||
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [ContentResolver.MimeTypeInfo](https://developer.android.com/reference/android/content/ContentResolver.MimeTypeInfo) Detailed description of a specific MIME type, including an icon and label that describe the type. |

|                                                                                                                                                                                                                                                                                                                                                                                                ### Constants                                                                                                                                                                                                                                                                                                                                                                                                 ||
|--------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | [ANY_CURSOR_ITEM_TYPE](https://developer.android.com/reference/android/content/ContentResolver#ANY_CURSOR_ITEM_TYPE) This is the Android platform's generic MIME type to match any MIME type of the form "[CURSOR_ITEM_BASE_TYPE](https://developer.android.com/reference/android/content/ContentResolver#CURSOR_ITEM_BASE_TYPE)/`SUB_TYPE`".                                                                                                                                                                                                                                                                                                                                                                                            |
| [String](https://developer.android.com/reference/java/lang/String) | [CURSOR_DIR_BASE_TYPE](https://developer.android.com/reference/android/content/ContentResolver#CURSOR_DIR_BASE_TYPE) This is the Android platform's base MIME type for a content: URI containing a Cursor of zero or more items.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [String](https://developer.android.com/reference/java/lang/String) | [CURSOR_ITEM_BASE_TYPE](https://developer.android.com/reference/android/content/ContentResolver#CURSOR_ITEM_BASE_TYPE) This is the Android platform's base MIME type for a content: URI containing a Cursor of a single item.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_HONORED_ARGS](https://developer.android.com/reference/android/content/ContentResolver#EXTRA_HONORED_ARGS) Allows provider to report back to client which query keys are honored in a Cursor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_REFRESH_SUPPORTED](https://developer.android.com/reference/android/content/ContentResolver#EXTRA_REFRESH_SUPPORTED) An extra boolean describing whether a particular provider supports refresh or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_SIZE](https://developer.android.com/reference/android/content/ContentResolver#EXTRA_SIZE) An extra[Point](https://developer.android.com/reference/android/graphics/Point)describing the optimal size for a requested image resource, in pixels.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_TOTAL_COUNT](https://developer.android.com/reference/android/content/ContentResolver#EXTRA_TOTAL_COUNT) Added to[Cursor](https://developer.android.com/reference/android/database/Cursor)extras[Bundle](https://developer.android.com/reference/android/os/Bundle)to indicate total row count of recordset when paging is supported.                                                                                                                                                                                                                                                                                                                                                                                              |
| `int`                                                              | [NOTIFY_DELETE](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_DELETE) Flag for[notifyChange(android.net.Uri, android.database.ContentObserver, int)](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20int)): typically set by a[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)to indicate that this notification is the result of a[ContentProvider.delete](https://developer.android.com/reference/android/content/ContentProvider#delete(android.net.Uri,%20android.os.Bundle))call.                                                                            |
| `int`                                                              | [NOTIFY_INSERT](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_INSERT) Flag for[notifyChange(android.net.Uri, android.database.ContentObserver, int)](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20int)): typically set by a[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)to indicate that this notification is the result of an[ContentProvider.insert](https://developer.android.com/reference/android/content/ContentProvider#insert(android.net.Uri,%20android.content.ContentValues))call.                                                               |
| `int`                                                              | [NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS) Flag for[notifyChange(android.net.Uri, android.database.ContentObserver, int)](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20int)): if set, this notification will be skipped if it is being delivered to the root URI of a ContentObserver that is using "notify for descendants." The purpose of this is to allow the provide to send a general notification of "something under X" changed that observers of that specific URI can receive, while also sending a specific URI under X. |
| `int`                                                              | [NOTIFY_SYNC_TO_NETWORK](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_SYNC_TO_NETWORK) Flag for[notifyChange(android.net.Uri, android.database.ContentObserver, int)](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20int)): attempt to sync the change to the network.                                                                                                                                                                                                                                                                                                                                    |
| `int`                                                              | [NOTIFY_UPDATE](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_UPDATE) Flag for[notifyChange(android.net.Uri, android.database.ContentObserver, int)](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20int)): typically set by a[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)to indicate that this notification is the result of an[ContentProvider.update](https://developer.android.com/reference/android/content/ContentProvider#update(android.net.Uri,%20android.content.ContentValues,%20android.os.Bundle))call.                                          |
| [String](https://developer.android.com/reference/java/lang/String) | [QUERY_ARG_GROUP_COLUMNS](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_GROUP_COLUMNS) Specifies the list of columns (stored as a`String[]`) against which to group results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [String](https://developer.android.com/reference/java/lang/String) | [QUERY_ARG_LIMIT](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_LIMIT) Specifies the max number of rows to include in a Cursor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [String](https://developer.android.com/reference/java/lang/String) | [QUERY_ARG_OFFSET](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_OFFSET) Specifies the offset row index within a Cursor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [String](https://developer.android.com/reference/java/lang/String) | [QUERY_ARG_SORT_COLLATION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLLATION) Allows client to specify a hint to the provider declaring which collation to use when sorting values.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [String](https://developer.android.com/reference/java/lang/String) | [QUERY_ARG_SORT_COLUMNS](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLUMNS) Specifies the list of columns (stored as a`String[]`) against which to sort results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [String](https://developer.android.com/reference/java/lang/String) | [QUERY_ARG_SORT_DIRECTION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_DIRECTION) Specifies desired sort order.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [String](https://developer.android.com/reference/java/lang/String) | [QUERY_ARG_SORT_LOCALE](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_LOCALE) Allows client to specify a hint to the provider declaring which locale to use when sorting values.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [String](https://developer.android.com/reference/java/lang/String) | [QUERY_ARG_SQL_GROUP_BY](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SQL_GROUP_BY) Key for an SQL style`GROUP BY`string that may be present in the query Bundle argument passed to[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)).                                                                                                                                                                                                                                                                  |
| [String](https://developer.android.com/reference/java/lang/String) | [QUERY_ARG_SQL_HAVING](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SQL_HAVING) Key for an SQL style`HAVING`string that may be present in the query Bundle argument passed to[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)).                                                                                                                                                                                                                                                                        |
| [String](https://developer.android.com/reference/java/lang/String) | [QUERY_ARG_SQL_LIMIT](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SQL_LIMIT) Key for an SQL style`LIMIT`string that may be present in the query Bundle argument passed to[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)).                                                                                                                                                                                                                                                                           |
| [String](https://developer.android.com/reference/java/lang/String) | [QUERY_ARG_SQL_SELECTION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SQL_SELECTION) Key for an SQL style selection string that may be present in the query Bundle argument passed to[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal))when called by a legacy client.                                                                                                                                                                                                                                 |
| [String](https://developer.android.com/reference/java/lang/String) | [QUERY_ARG_SQL_SELECTION_ARGS](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SQL_SELECTION_ARGS) Key for SQL selection string arguments list.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [String](https://developer.android.com/reference/java/lang/String) | [QUERY_ARG_SQL_SORT_ORDER](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SQL_SORT_ORDER) Key for an SQL style sort string that may be present in the query Bundle argument passed to[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal))when called by a legacy client.                                                                                                                                                                                                                                    |
| `int`                                                              | [QUERY_SORT_DIRECTION_ASCENDING](https://developer.android.com/reference/android/content/ContentResolver#QUERY_SORT_DIRECTION_ASCENDING) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `int`                                                              | [QUERY_SORT_DIRECTION_DESCENDING](https://developer.android.com/reference/android/content/ContentResolver#QUERY_SORT_DIRECTION_DESCENDING) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [String](https://developer.android.com/reference/java/lang/String) | [SCHEME_ANDROID_RESOURCE](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_ANDROID_RESOURCE) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [String](https://developer.android.com/reference/java/lang/String) | [SCHEME_CONTENT](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_CONTENT) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [String](https://developer.android.com/reference/java/lang/String) | [SCHEME_FILE](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_FILE) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [String](https://developer.android.com/reference/java/lang/String) | [SYNC_EXTRAS_ACCOUNT](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_ACCOUNT) *This constant was deprecated in API level 15. instead use[requestSync(android.accounts.Account, java.lang.String, android.os.Bundle)](https://developer.android.com/reference/android/content/ContentResolver#requestSync(android.accounts.Account,%20java.lang.String,%20android.os.Bundle))*                                                                                                                                                                                                                                                                                                                       |
| [String](https://developer.android.com/reference/java/lang/String) | [SYNC_EXTRAS_DISCARD_LOCAL_DELETIONS](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_DISCARD_LOCAL_DELETIONS) Indicates that the sync adapter should not proceed with the delete operations, if it determines that there are too many.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [String](https://developer.android.com/reference/java/lang/String) | [SYNC_EXTRAS_DO_NOT_RETRY](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_DO_NOT_RETRY) If this extra is set to true then the request will not be retried if it fails.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [String](https://developer.android.com/reference/java/lang/String) | [SYNC_EXTRAS_EXPEDITED](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_EXPEDITED) If this extra is set to true, the sync request will be scheduled at the front of the sync request queue, but it is still subject to JobScheduler quota and throttling due to App Standby buckets.                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [String](https://developer.android.com/reference/java/lang/String) | [SYNC_EXTRAS_FORCE](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_FORCE) *This constant was deprecated in API level 15. instead use[SYNC_EXTRAS_MANUAL](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_MANUAL)*                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [String](https://developer.android.com/reference/java/lang/String) | [SYNC_EXTRAS_IGNORE_BACKOFF](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_IGNORE_BACKOFF) If this extra is set to true then any backoffs for the initial attempt (e.g. due to retries) are ignored by the sync scheduler.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [String](https://developer.android.com/reference/java/lang/String) | [SYNC_EXTRAS_IGNORE_SETTINGS](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_IGNORE_SETTINGS) If this extra is set to true then the sync settings (like getSyncAutomatically()) are ignored by the sync scheduler.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [String](https://developer.android.com/reference/java/lang/String) | [SYNC_EXTRAS_INITIALIZE](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_INITIALIZE) Set by the SyncManager to request that the SyncAdapter initialize itself for the given account/authority pair.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [String](https://developer.android.com/reference/java/lang/String) | [SYNC_EXTRAS_MANUAL](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_MANUAL) Setting this extra is the equivalent of setting both[SYNC_EXTRAS_IGNORE_SETTINGS](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_IGNORE_SETTINGS)and[SYNC_EXTRAS_IGNORE_BACKOFF](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_IGNORE_BACKOFF)                                                                                                                                                                                                                                                                                               |
| [String](https://developer.android.com/reference/java/lang/String) | [SYNC_EXTRAS_OVERRIDE_TOO_MANY_DELETIONS](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_OVERRIDE_TOO_MANY_DELETIONS) Indicates that the sync adapter should proceed with the delete operations, even if it determines that there are too many.                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [String](https://developer.android.com/reference/java/lang/String) | [SYNC_EXTRAS_REQUIRE_CHARGING](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_REQUIRE_CHARGING) If this extra is set to true, the sync request will be scheduled only when the device is plugged in.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [String](https://developer.android.com/reference/java/lang/String) | [SYNC_EXTRAS_SCHEDULE_AS_EXPEDITED_JOB](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_SCHEDULE_AS_EXPEDITED_JOB) Run this sync operation as an "expedited job" (see[JobInfo.Builder.setExpedited(boolean)](https://developer.android.com/reference/android/app/job/JobInfo.Builder#setExpedited(boolean))).                                                                                                                                                                                                                                                                                                                                                                                        |
| [String](https://developer.android.com/reference/java/lang/String) | [SYNC_EXTRAS_UPLOAD](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_UPLOAD) Indicates that this sync is intended to only upload local changes to the server.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `int`                                                              | [SYNC_OBSERVER_TYPE_ACTIVE](https://developer.android.com/reference/android/content/ContentResolver#SYNC_OBSERVER_TYPE_ACTIVE) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `int`                                                              | [SYNC_OBSERVER_TYPE_PENDING](https://developer.android.com/reference/android/content/ContentResolver#SYNC_OBSERVER_TYPE_PENDING) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `int`                                                              | [SYNC_OBSERVER_TYPE_SETTINGS](https://developer.android.com/reference/android/content/ContentResolver#SYNC_OBSERVER_TYPE_SETTINGS) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

|                                                                                                                                                                                       ### Public constructors                                                                                                                                                                                       ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver#ContentResolver(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context)` context) ` Note: passing a`null`context here could lead to unexpected behavior in certain ContentResolver APIs so it is highly recommended to pass a non-null context here. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` final `[ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient)                                                    | ` `[acquireContentProviderClient](https://developer.android.com/reference/android/content/ContentResolver#acquireContentProviderClient(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri) ` Returns a[ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient)that is associated with the[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)that services the content at uri, starting the provider if necessary.                                                                                                                                                                                                                                                                                                                                                                                              |
| ` final `[ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient)                                                    | ` `[acquireContentProviderClient](https://developer.android.com/reference/android/content/ContentResolver#acquireContentProviderClient(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` name) ` Returns a[ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient)that is associated with the[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)with the authority of name, starting the provider if necessary.                                                                                                                                                                                                                                                                                                                                                                                              |
| ` final `[ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient)                                                    | ` `[acquireUnstableContentProviderClient](https://developer.android.com/reference/android/content/ContentResolver#acquireUnstableContentProviderClient(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` name) ` Like[acquireContentProviderClient(java.lang.String)](https://developer.android.com/reference/android/content/ContentResolver#acquireContentProviderClient(java.lang.String)), but for use when you do not trust the stability of the target content provider.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` final `[ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient)                                                    | ` `[acquireUnstableContentProviderClient](https://developer.android.com/reference/android/content/ContentResolver#acquireUnstableContentProviderClient(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri) ` Like[acquireContentProviderClient(android.net.Uri)](https://developer.android.com/reference/android/content/ContentResolver#acquireContentProviderClient(android.net.Uri)), but for use when you do not trust the stability of the target content provider.                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` static void`                                                                                                                                                     | ` `[addPeriodicSync](https://developer.android.com/reference/android/content/ContentResolver#addPeriodicSync(android.accounts.Account,%20java.lang.String,%20android.os.Bundle,%20long))`(`[Account](https://developer.android.com/reference/android/accounts/Account)` account, `[String](https://developer.android.com/reference/java/lang/String)` authority, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras, long pollFrequency) ` Specifies that a sync should be requested with the specified the account, authority, and extras at the given frequency.                                                                                                                                                                                                                                                                                                                                             |
| ` static `[Object](https://developer.android.com/reference/java/lang/Object)                                                                                       | ` `[addStatusChangeListener](https://developer.android.com/reference/android/content/ContentResolver#addStatusChangeListener(int,%20android.content.SyncStatusObserver))`(int mask, `[SyncStatusObserver](https://developer.android.com/reference/android/content/SyncStatusObserver)` callback) ` Request notifications when the different aspects of the SyncManager change.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` `[ContentProviderResult[]](https://developer.android.com/reference/android/content/ContentProviderResult)                                                        | ` `[applyBatch](https://developer.android.com/reference/android/content/ContentResolver#applyBatch(java.lang.String,%20java.util.ArrayList<android.content.ContentProviderOperation>))`(`[String](https://developer.android.com/reference/java/lang/String)` authority, `[ArrayList](https://developer.android.com/reference/java/util/ArrayList)`<`[ContentProviderOperation](https://developer.android.com/reference/android/content/ContentProviderOperation)`> operations) ` Applies each of the[ContentProviderOperation](https://developer.android.com/reference/android/content/ContentProviderOperation)objects and returns an array of their results.                                                                                                                                                                                                                                                                           |
| ` final int`                                                                                                                                                       | ` `[bulkInsert](https://developer.android.com/reference/android/content/ContentResolver#bulkInsert(android.net.Uri,%20android.content.ContentValues[]))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` url, `[ContentValues[]](https://developer.android.com/reference/android/content/ContentValues)` values) ` Inserts multiple rows into a table at the given URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` final `[Bundle](https://developer.android.com/reference/android/os/Bundle)                                                                                       | ` `[call](https://developer.android.com/reference/android/content/ContentResolver#call(android.net.Uri,%20java.lang.String,%20java.lang.String,%20android.os.Bundle))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[String](https://developer.android.com/reference/java/lang/String)` method, `[String](https://developer.android.com/reference/java/lang/String)` arg, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` Call a provider-defined method.                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` final `[Bundle](https://developer.android.com/reference/android/os/Bundle)                                                                                       | ` `[call](https://developer.android.com/reference/android/content/ContentResolver#call(java.lang.String,%20java.lang.String,%20java.lang.String,%20android.os.Bundle))`(`[String](https://developer.android.com/reference/java/lang/String)` authority, `[String](https://developer.android.com/reference/java/lang/String)` method, `[String](https://developer.android.com/reference/java/lang/String)` arg, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` void`                                                                                                                                                            | ` `[cancelSync](https://developer.android.com/reference/android/content/ContentResolver#cancelSync(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri) ` *This method was deprecated in API level 15. instead use[cancelSync(android.accounts.Account, java.lang.String)](https://developer.android.com/reference/android/content/ContentResolver#cancelSync(android.accounts.Account,%20java.lang.String))*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` static void`                                                                                                                                                     | ` `[cancelSync](https://developer.android.com/reference/android/content/ContentResolver#cancelSync(android.content.SyncRequest))`(`[SyncRequest](https://developer.android.com/reference/android/content/SyncRequest)` request) ` Remove the specified sync.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` static void`                                                                                                                                                     | ` `[cancelSync](https://developer.android.com/reference/android/content/ContentResolver#cancelSync(android.accounts.Account,%20java.lang.String))`(`[Account](https://developer.android.com/reference/android/accounts/Account)` account, `[String](https://developer.android.com/reference/java/lang/String)` authority) ` Cancel any active or pending syncs that match account and authority.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` final `[Uri](https://developer.android.com/reference/android/net/Uri)                                                                                            | ` `[canonicalize](https://developer.android.com/reference/android/content/ContentResolver#canonicalize(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` url) ` Transform the given<var translate="no">url</var>to a canonical representation of its referenced resource, which can be used across devices, persisted, backed up and restored, etc.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` final int`                                                                                                                                                       | ` `[delete](https://developer.android.com/reference/android/content/ContentResolver#delete(android.net.Uri,%20java.lang.String,%20java.lang.String[]))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` url, `[String](https://developer.android.com/reference/java/lang/String)` where, `[String[]](https://developer.android.com/reference/java/lang/String)` selectionArgs) ` Deletes row(s) specified by a content URI.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` final int`                                                                                                                                                       | ` `[delete](https://developer.android.com/reference/android/content/ContentResolver#delete(android.net.Uri,%20android.os.Bundle))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` url, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` Deletes row(s) specified by a content URI.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` static `[SyncInfo](https://developer.android.com/reference/android/content/SyncInfo)                                                                             | ` `[getCurrentSync](https://developer.android.com/reference/android/content/ContentResolver#getCurrentSync())`() ` *This method was deprecated in API level 15. Since multiple concurrent syncs are now supported you should use[getCurrentSyncs()](https://developer.android.com/reference/android/content/ContentResolver#getCurrentSyncs())to get the accurate list of current syncs. This method returns the first item from the list of current syncs or null if there are none.*                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` static `[List](https://developer.android.com/reference/java/util/List)`<`[SyncInfo](https://developer.android.com/reference/android/content/SyncInfo)`>`         | ` `[getCurrentSyncs](https://developer.android.com/reference/android/content/ContentResolver#getCurrentSyncs())`() ` Returns a list with information about all the active syncs.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` static int`                                                                                                                                                      | ` `[getIsSyncable](https://developer.android.com/reference/android/content/ContentResolver#getIsSyncable(android.accounts.Account,%20java.lang.String))`(`[Account](https://developer.android.com/reference/android/accounts/Account)` account, `[String](https://developer.android.com/reference/java/lang/String)` authority) ` Check if this account/provider is syncable.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` static boolean`                                                                                                                                                  | ` `[getMasterSyncAutomatically](https://developer.android.com/reference/android/content/ContentResolver#getMasterSyncAutomatically())`() ` Gets the global auto-sync setting that applies to all the providers and accounts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` `[List](https://developer.android.com/reference/java/util/List)`<`[UriPermission](https://developer.android.com/reference/android/content/UriPermission)`>`      | ` `[getOutgoingPersistedUriPermissions](https://developer.android.com/reference/android/content/ContentResolver#getOutgoingPersistedUriPermissions())`() ` Return list of all persisted URI permission grants that are hosted by the calling app.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` static `[List](https://developer.android.com/reference/java/util/List)`<`[PeriodicSync](https://developer.android.com/reference/android/content/PeriodicSync)`>` | ` `[getPeriodicSyncs](https://developer.android.com/reference/android/content/ContentResolver#getPeriodicSyncs(android.accounts.Account,%20java.lang.String))`(`[Account](https://developer.android.com/reference/android/accounts/Account)` account, `[String](https://developer.android.com/reference/java/lang/String)` authority) ` Get the list of information about the periodic syncs for the given account and authority.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` `[List](https://developer.android.com/reference/java/util/List)`<`[UriPermission](https://developer.android.com/reference/android/content/UriPermission)`>`      | ` `[getPersistedUriPermissions](https://developer.android.com/reference/android/content/ContentResolver#getPersistedUriPermissions())`() ` Return list of all URI permission grants that have been persisted by the calling app.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` `[String[]](https://developer.android.com/reference/java/lang/String)                                                                                            | ` `[getStreamTypes](https://developer.android.com/reference/android/content/ContentResolver#getStreamTypes(android.net.Uri,%20java.lang.String))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` url, `[String](https://developer.android.com/reference/java/lang/String)` mimeTypeFilter) ` Query for the possible MIME types for the representations the given content URL can be returned when opened as as stream with[openTypedAssetFileDescriptor(Uri, String, Bundle)](https://developer.android.com/reference/android/content/ContentResolver#openTypedAssetFileDescriptor(android.net.Uri,%20java.lang.String,%20android.os.Bundle)).                                                                                                                                                                                                                                                                         |
| ` static `[SyncAdapterType[]](https://developer.android.com/reference/android/content/SyncAdapterType)                                                             | ` `[getSyncAdapterTypes](https://developer.android.com/reference/android/content/ContentResolver#getSyncAdapterTypes())`() ` Get information about the SyncAdapters that are known to the system.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` static boolean`                                                                                                                                                  | ` `[getSyncAutomatically](https://developer.android.com/reference/android/content/ContentResolver#getSyncAutomatically(android.accounts.Account,%20java.lang.String))`(`[Account](https://developer.android.com/reference/android/accounts/Account)` account, `[String](https://developer.android.com/reference/java/lang/String)` authority) ` Check if the provider should be synced when a network tickle is received This method requires the caller to hold the permission[Manifest.permission.READ_SYNC_SETTINGS](https://developer.android.com/reference/android/Manifest.permission#READ_SYNC_SETTINGS).                                                                                                                                                                                                                                                                                                                         |
| ` final `[String](https://developer.android.com/reference/java/lang/String)                                                                                        | ` `[getType](https://developer.android.com/reference/android/content/ContentResolver#getType(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` url) ` Return the MIME type of the given content URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` final `[ContentResolver.MimeTypeInfo](https://developer.android.com/reference/android/content/ContentResolver.MimeTypeInfo)                                      | ` `[getTypeInfo](https://developer.android.com/reference/android/content/ContentResolver#getTypeInfo(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` mimeType) ` Return a detailed description of the given MIME type, including an icon and label that describe the type.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` final `[Uri](https://developer.android.com/reference/android/net/Uri)                                                                                            | ` `[insert](https://developer.android.com/reference/android/content/ContentResolver#insert(android.net.Uri,%20android.content.ContentValues,%20android.os.Bundle))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` url, `[ContentValues](https://developer.android.com/reference/android/content/ContentValues)` values, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` Inserts a row into a table at the given URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` final `[Uri](https://developer.android.com/reference/android/net/Uri)                                                                                            | ` `[insert](https://developer.android.com/reference/android/content/ContentResolver#insert(android.net.Uri,%20android.content.ContentValues))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` url, `[ContentValues](https://developer.android.com/reference/android/content/ContentValues)` values) ` Inserts a row into a table at the given URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` static boolean`                                                                                                                                                  | ` `[isSyncActive](https://developer.android.com/reference/android/content/ContentResolver#isSyncActive(android.accounts.Account,%20java.lang.String))`(`[Account](https://developer.android.com/reference/android/accounts/Account)` account, `[String](https://developer.android.com/reference/java/lang/String)` authority) ` Returns true if there is currently a sync operation for the given account or authority actively being processed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` static boolean`                                                                                                                                                  | ` `[isSyncPending](https://developer.android.com/reference/android/content/ContentResolver#isSyncPending(android.accounts.Account,%20java.lang.String))`(`[Account](https://developer.android.com/reference/android/accounts/Account)` account, `[String](https://developer.android.com/reference/java/lang/String)` authority) ` Return true if the pending status is true of any matching authorities.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` `[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap)                                                                                       | ` `[loadThumbnail](https://developer.android.com/reference/android/content/ContentResolver#loadThumbnail(android.net.Uri,%20android.util.Size,%20android.os.CancellationSignal))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[Size](https://developer.android.com/reference/android/util/Size)` size, `[CancellationSignal](https://developer.android.com/reference/android/os/CancellationSignal)` signal) ` Convenience method that efficiently loads a visual thumbnail for the given[Uri](https://developer.android.com/reference/android/net/Uri).                                                                                                                                                                                                                                                                                                                                                      |
| ` void`                                                                                                                                                            | ` `[notifyChange](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(java.util.Collection<android.net.Uri>,%20android.database.ContentObserver,%20int))`(`[Collection](https://developer.android.com/reference/java/util/Collection)`<`[Uri](https://developer.android.com/reference/android/net/Uri)`> uris, `[ContentObserver](https://developer.android.com/reference/android/database/ContentObserver)` observer, int flags) ` Notify registered observers that several rows have been updated.                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` void`                                                                                                                                                            | ` `[notifyChange](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20boolean))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[ContentObserver](https://developer.android.com/reference/android/database/ContentObserver)` observer, boolean syncToNetwork) ` *This method was deprecated in API level 30. callers should consider migrating to[notifyChange(android.net.Uri, android.database.ContentObserver, int)](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20int)), as it offers support for many more options than just[NOTIFY_SYNC_TO_NETWORK](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_SYNC_TO_NETWORK).*                                                                |
| ` void`                                                                                                                                                            | ` `[notifyChange](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20int))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[ContentObserver](https://developer.android.com/reference/android/database/ContentObserver)` observer, int flags) ` Notify registered observers that a row was updated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` void`                                                                                                                                                            | ` `[notifyChange](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[ContentObserver](https://developer.android.com/reference/android/database/ContentObserver)` observer) ` Notify registered observers that a row was updated and attempt to sync changes to the network.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` final `[AssetFileDescriptor](https://developer.android.com/reference/android/content/res/AssetFileDescriptor)                                                    | ` `[openAssetFile](https://developer.android.com/reference/android/content/ContentResolver#openAssetFile(android.net.Uri,%20java.lang.String,%20android.os.CancellationSignal))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[String](https://developer.android.com/reference/java/lang/String)` mode, `[CancellationSignal](https://developer.android.com/reference/android/os/CancellationSignal)` signal) ` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` final `[AssetFileDescriptor](https://developer.android.com/reference/android/content/res/AssetFileDescriptor)                                                    | ` `[openAssetFileDescriptor](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String,%20android.os.CancellationSignal))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[String](https://developer.android.com/reference/java/lang/String)` mode, `[CancellationSignal](https://developer.android.com/reference/android/os/CancellationSignal)` cancellationSignal) ` Open a raw file descriptor to access data under a URI.                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` final `[AssetFileDescriptor](https://developer.android.com/reference/android/content/res/AssetFileDescriptor)                                                    | ` `[openAssetFileDescriptor](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[String](https://developer.android.com/reference/java/lang/String)` mode) ` Open a raw file descriptor to access data under a URI.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` final `[ParcelFileDescriptor](https://developer.android.com/reference/android/os/ParcelFileDescriptor)                                                           | ` `[openFile](https://developer.android.com/reference/android/content/ContentResolver#openFile(android.net.Uri,%20java.lang.String,%20android.os.CancellationSignal))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[String](https://developer.android.com/reference/java/lang/String)` mode, `[CancellationSignal](https://developer.android.com/reference/android/os/CancellationSignal)` signal) ` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` final `[ParcelFileDescriptor](https://developer.android.com/reference/android/os/ParcelFileDescriptor)                                                           | ` `[openFileDescriptor](https://developer.android.com/reference/android/content/ContentResolver#openFileDescriptor(android.net.Uri,%20java.lang.String,%20android.os.CancellationSignal))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[String](https://developer.android.com/reference/java/lang/String)` mode, `[CancellationSignal](https://developer.android.com/reference/android/os/CancellationSignal)` cancellationSignal) ` Open a raw file descriptor to access data under a URI.                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` final `[ParcelFileDescriptor](https://developer.android.com/reference/android/os/ParcelFileDescriptor)                                                           | ` `[openFileDescriptor](https://developer.android.com/reference/android/content/ContentResolver#openFileDescriptor(android.net.Uri,%20java.lang.String))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[String](https://developer.android.com/reference/java/lang/String)` mode) ` Open a raw file descriptor to access data under a URI.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` final `[InputStream](https://developer.android.com/reference/java/io/InputStream)                                                                                | ` `[openInputStream](https://developer.android.com/reference/android/content/ContentResolver#openInputStream(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri) ` Open a stream on to the content associated with a content URI.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` final `[OutputStream](https://developer.android.com/reference/java/io/OutputStream)                                                                              | ` `[openOutputStream](https://developer.android.com/reference/android/content/ContentResolver#openOutputStream(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri) ` Synonym for[openOutputStream(uri, "w")](https://developer.android.com/reference/android/content/ContentResolver#openOutputStream(android.net.Uri,%20java.lang.String)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` final `[OutputStream](https://developer.android.com/reference/java/io/OutputStream)                                                                              | ` `[openOutputStream](https://developer.android.com/reference/android/content/ContentResolver#openOutputStream(android.net.Uri,%20java.lang.String))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[String](https://developer.android.com/reference/java/lang/String)` mode) ` Open a stream on to the content associated with a content URI.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` final `[AssetFileDescriptor](https://developer.android.com/reference/android/content/res/AssetFileDescriptor)                                                    | ` `[openTypedAssetFile](https://developer.android.com/reference/android/content/ContentResolver#openTypedAssetFile(android.net.Uri,%20java.lang.String,%20android.os.Bundle,%20android.os.CancellationSignal))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[String](https://developer.android.com/reference/java/lang/String)` mimeTypeFilter, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` opts, `[CancellationSignal](https://developer.android.com/reference/android/os/CancellationSignal)` signal) ` <br />                                                                                                                                                                                                                                                                                                                                                                    |
| ` final `[AssetFileDescriptor](https://developer.android.com/reference/android/content/res/AssetFileDescriptor)                                                    | ` `[openTypedAssetFileDescriptor](https://developer.android.com/reference/android/content/ContentResolver#openTypedAssetFileDescriptor(android.net.Uri,%20java.lang.String,%20android.os.Bundle,%20android.os.CancellationSignal))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[String](https://developer.android.com/reference/java/lang/String)` mimeType, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` opts, `[CancellationSignal](https://developer.android.com/reference/android/os/CancellationSignal)` cancellationSignal) ` Open a raw file descriptor to access (potentially type transformed) data from a "content:" URI.                                                                                                                                                                                                                                                 |
| ` final `[AssetFileDescriptor](https://developer.android.com/reference/android/content/res/AssetFileDescriptor)                                                    | ` `[openTypedAssetFileDescriptor](https://developer.android.com/reference/android/content/ContentResolver#openTypedAssetFileDescriptor(android.net.Uri,%20java.lang.String,%20android.os.Bundle))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[String](https://developer.android.com/reference/java/lang/String)` mimeType, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` opts) ` Open a raw file descriptor to access (potentially type transformed) data from a "content:" URI.                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` final `[Cursor](https://developer.android.com/reference/android/database/Cursor)                                                                                 | ` `[query](https://developer.android.com/reference/android/content/ContentResolver#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[String[]](https://developer.android.com/reference/java/lang/String)` projection, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` queryArgs, `[CancellationSignal](https://developer.android.com/reference/android/os/CancellationSignal)` cancellationSignal) ` Query the given URI, returning a[Cursor](https://developer.android.com/reference/android/database/Cursor)over the result set with support for cancellation.                                                                                                                                                                                                                        |
| ` final `[Cursor](https://developer.android.com/reference/android/database/Cursor)                                                                                 | ` `[query](https://developer.android.com/reference/android/content/ContentResolver#query(android.net.Uri,%20java.lang.String[],%20java.lang.String,%20java.lang.String[],%20java.lang.String,%20android.os.CancellationSignal))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[String[]](https://developer.android.com/reference/java/lang/String)` projection, `[String](https://developer.android.com/reference/java/lang/String)` selection, `[String[]](https://developer.android.com/reference/java/lang/String)` selectionArgs, `[String](https://developer.android.com/reference/java/lang/String)` sortOrder, `[CancellationSignal](https://developer.android.com/reference/android/os/CancellationSignal)` cancellationSignal) ` Query the given URI, returning a[Cursor](https://developer.android.com/reference/android/database/Cursor)over the result set with optional support for cancellation. |
| ` final `[Cursor](https://developer.android.com/reference/android/database/Cursor)                                                                                 | ` `[query](https://developer.android.com/reference/android/content/ContentResolver#query(android.net.Uri,%20java.lang.String[],%20java.lang.String,%20java.lang.String[],%20java.lang.String))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[String[]](https://developer.android.com/reference/java/lang/String)` projection, `[String](https://developer.android.com/reference/java/lang/String)` selection, `[String[]](https://developer.android.com/reference/java/lang/String)` selectionArgs, `[String](https://developer.android.com/reference/java/lang/String)` sortOrder) ` Query the given URI, returning a[Cursor](https://developer.android.com/reference/android/database/Cursor)over the result set.                                                                                                                                                                                           |
| ` final boolean`                                                                                                                                                   | ` `[refresh](https://developer.android.com/reference/android/content/ContentResolver#refresh(android.net.Uri,%20android.os.Bundle,%20android.os.CancellationSignal))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` url, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras, `[CancellationSignal](https://developer.android.com/reference/android/os/CancellationSignal)` cancellationSignal) ` This allows clients to request an explicit refresh of content identified by`uri`.                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` final void`                                                                                                                                                      | ` `[registerContentObserver](https://developer.android.com/reference/android/content/ContentResolver#registerContentObserver(android.net.Uri,%20boolean,%20android.database.ContentObserver))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, boolean notifyForDescendants, `[ContentObserver](https://developer.android.com/reference/android/database/ContentObserver)` observer) ` Register an observer class that gets callbacks when data identified by a given content URI changes.                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` void`                                                                                                                                                            | ` `[releasePersistableUriPermission](https://developer.android.com/reference/android/content/ContentResolver#releasePersistableUriPermission(android.net.Uri,%20int))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, int modeFlags) ` Relinquish a persisted URI permission grant.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` static void`                                                                                                                                                     | ` `[removePeriodicSync](https://developer.android.com/reference/android/content/ContentResolver#removePeriodicSync(android.accounts.Account,%20java.lang.String,%20android.os.Bundle))`(`[Account](https://developer.android.com/reference/android/accounts/Account)` account, `[String](https://developer.android.com/reference/java/lang/String)` authority, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` Remove a periodic sync.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` static void`                                                                                                                                                     | ` `[removeStatusChangeListener](https://developer.android.com/reference/android/content/ContentResolver#removeStatusChangeListener(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` handle) ` Remove a previously registered status change listener.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` static void`                                                                                                                                                     | ` `[requestSync](https://developer.android.com/reference/android/content/ContentResolver#requestSync(android.accounts.Account,%20java.lang.String,%20android.os.Bundle))`(`[Account](https://developer.android.com/reference/android/accounts/Account)` account, `[String](https://developer.android.com/reference/java/lang/String)` authority, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` Start an asynchronous sync operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` static void`                                                                                                                                                     | ` `[requestSync](https://developer.android.com/reference/android/content/ContentResolver#requestSync(android.content.SyncRequest))`(`[SyncRequest](https://developer.android.com/reference/android/content/SyncRequest)` request) ` Register a sync with the SyncManager.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` static void`                                                                                                                                                     | ` `[setIsSyncable](https://developer.android.com/reference/android/content/ContentResolver#setIsSyncable(android.accounts.Account,%20java.lang.String,%20int))`(`[Account](https://developer.android.com/reference/android/accounts/Account)` account, `[String](https://developer.android.com/reference/java/lang/String)` authority, int syncable) ` Set whether this account/provider is syncable.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` static void`                                                                                                                                                     | ` `[setMasterSyncAutomatically](https://developer.android.com/reference/android/content/ContentResolver#setMasterSyncAutomatically(boolean))`(boolean sync) ` Sets the global auto-sync setting that applies to all the providers and accounts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` static void`                                                                                                                                                     | ` `[setSyncAutomatically](https://developer.android.com/reference/android/content/ContentResolver#setSyncAutomatically(android.accounts.Account,%20java.lang.String,%20boolean))`(`[Account](https://developer.android.com/reference/android/accounts/Account)` account, `[String](https://developer.android.com/reference/java/lang/String)` authority, boolean sync) ` Set whether or not the provider is synced when it receives a network tickle.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` void`                                                                                                                                                            | ` `[startSync](https://developer.android.com/reference/android/content/ContentResolver#startSync(android.net.Uri,%20android.os.Bundle))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` *This method was deprecated in API level 15. instead use[requestSync(android.accounts.Account, java.lang.String, android.os.Bundle)](https://developer.android.com/reference/android/content/ContentResolver#requestSync(android.accounts.Account,%20java.lang.String,%20android.os.Bundle))*                                                                                                                                                                                                                                                                                                                                             |
| ` void`                                                                                                                                                            | ` `[takePersistableUriPermission](https://developer.android.com/reference/android/content/ContentResolver#takePersistableUriPermission(android.net.Uri,%20int))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, int modeFlags) ` Take a persistable URI permission grant that has been offered.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` final `[Uri](https://developer.android.com/reference/android/net/Uri)                                                                                            | ` `[uncanonicalize](https://developer.android.com/reference/android/content/ContentResolver#uncanonicalize(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` url) ` Given a canonical Uri previously generated by[canonicalize(Uri)](https://developer.android.com/reference/android/content/ContentResolver#canonicalize(android.net.Uri)), convert it to its local non-canonical form.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` final void`                                                                                                                                                      | ` `[unregisterContentObserver](https://developer.android.com/reference/android/content/ContentResolver#unregisterContentObserver(android.database.ContentObserver))`(`[ContentObserver](https://developer.android.com/reference/android/database/ContentObserver)` observer) ` Unregisters a change observer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` final int`                                                                                                                                                       | ` `[update](https://developer.android.com/reference/android/content/ContentResolver#update(android.net.Uri,%20android.content.ContentValues,%20android.os.Bundle))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[ContentValues](https://developer.android.com/reference/android/content/ContentValues)` values, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` Update row(s) in a content URI.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` final int`                                                                                                                                                       | ` `[update](https://developer.android.com/reference/android/content/ContentResolver#update(android.net.Uri,%20android.content.ContentValues,%20java.lang.String,%20java.lang.String[]))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri, `[ContentValues](https://developer.android.com/reference/android/content/ContentValues)` values, `[String](https://developer.android.com/reference/java/lang/String)` where, `[String[]](https://developer.android.com/reference/java/lang/String)` selectionArgs) ` Update row(s) in a content URI.                                                                                                                                                                                                                                                                                                                                                                      |
| ` static void`                                                                                                                                                     | ` `[validateSyncExtrasBundle](https://developer.android.com/reference/android/content/ContentResolver#validateSyncExtrasBundle(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` Check that only values of the following types are in the Bundle: - Integer - Long - Boolean - Float - Double - String - Account - null <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` static `[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)                                                               | ` `[wrap](https://developer.android.com/reference/android/content/ContentResolver#wrap(android.content.ContentProviderClient))`(`[ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient)` wrapped) ` Create a[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)instance that redirects all its methods to the given[ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient).                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` static `[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)                                                               | ` `[wrap](https://developer.android.com/reference/android/content/ContentResolver#wrap(android.content.ContentProvider))`(`[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)` wrapped) ` Create a[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)instance that redirects all its methods to the given[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider).                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### ANY_CURSOR_ITEM_TYPE

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String ANY_CURSOR_ITEM_TYPE
```

This is the Android platform's generic MIME type to match any MIME type of the form "[CURSOR_ITEM_BASE_TYPE](https://developer.android.com/reference/android/content/ContentResolver#CURSOR_ITEM_BASE_TYPE)/`SUB_TYPE`".`SUB_TYPE`is the sub-type of the application-dependent content, e.g., "audio", "video", "playlist".

<br />

Constant Value: "vnd.android.cursor.item/\*"  

### CURSOR_DIR_BASE_TYPE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String CURSOR_DIR_BASE_TYPE
```

This is the Android platform's base MIME type for a content: URI containing a Cursor of zero or more items. Applications should use this as the base type along with their own sub-type of their content: URIs that represent a directory of items. For example, hypothetical IMAP email client may have a URI`content://com.company.provider.imap/inbox`for all of the messages in its inbox, whose MIME type would be reported as`CURSOR_DIR_BASE_TYPE + "/vnd.company.imap-msg"`

Note how the base MIME type varies between this and[CURSOR_ITEM_BASE_TYPE](https://developer.android.com/reference/android/content/ContentResolver#CURSOR_ITEM_BASE_TYPE)depending on whether there is one single item or multiple items in the data set, while the sub-type remains the same because in either case the data structure contained in the cursor is the same.

<br />

Constant Value: "vnd.android.cursor.dir"  

### CURSOR_ITEM_BASE_TYPE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String CURSOR_ITEM_BASE_TYPE
```

This is the Android platform's base MIME type for a content: URI containing a Cursor of a single item. Applications should use this as the base type along with their own sub-type of their content: URIs that represent a particular item. For example, hypothetical IMAP email client may have a URI`content://com.company.provider.imap/inbox/1`for a particular message in the inbox, whose MIME type would be reported as`CURSOR_ITEM_BASE_TYPE + "/vnd.company.imap-msg"`

Compare with[CURSOR_DIR_BASE_TYPE](https://developer.android.com/reference/android/content/ContentResolver#CURSOR_DIR_BASE_TYPE).

<br />

Constant Value: "vnd.android.cursor.item"  

### EXTRA_HONORED_ARGS

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_HONORED_ARGS
```

Allows provider to report back to client which query keys are honored in a Cursor.

Key identifying a`String[]`containing all QUERY_ARG_SORT\* arguments honored by the provider. Include this in[Cursor](https://developer.android.com/reference/android/database/Cursor)extras[Bundle](https://developer.android.com/reference/android/os/Bundle)when any QUERY_ARG_SORT\* value was honored during the preparation of the results[Cursor](https://developer.android.com/reference/android/database/Cursor).

If present, ALL honored arguments are enumerated in this extra\\u2019s payload.

<br />

**See also:**

- [QUERY_ARG_SORT_COLUMNS](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLUMNS)
- [QUERY_ARG_SORT_DIRECTION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_DIRECTION)
- [QUERY_ARG_SORT_COLLATION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLLATION)
- [QUERY_ARG_SORT_LOCALE](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_LOCALE)
- [QUERY_ARG_GROUP_COLUMNS](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_GROUP_COLUMNS)

Constant Value: "android.content.extra.HONORED_ARGS"  

### EXTRA_REFRESH_SUPPORTED

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_REFRESH_SUPPORTED
```

An extra boolean describing whether a particular provider supports refresh or not. If a provider supports refresh, it should include this key in its returned Cursor as part of its query call.

<br />

Constant Value: "android.content.extra.REFRESH_SUPPORTED"  

### EXTRA_SIZE

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_SIZE
```

An extra[Point](https://developer.android.com/reference/android/graphics/Point)describing the optimal size for a requested image resource, in pixels. If a provider has multiple sizes of the image, it should return the image closest to this size.

<br />

**See also:**

- [openTypedAssetFileDescriptor(Uri, String, Bundle)](https://developer.android.com/reference/android/content/ContentResolver#openTypedAssetFileDescriptor(android.net.Uri,%20java.lang.String,%20android.os.Bundle))
- [openTypedAssetFileDescriptor(Uri, String, Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentResolver#openTypedAssetFileDescriptor(android.net.Uri,%20java.lang.String,%20android.os.Bundle,%20android.os.CancellationSignal))

Constant Value: "android.content.extra.SIZE"  

### EXTRA_TOTAL_COUNT

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_TOTAL_COUNT
```

Added to[Cursor](https://developer.android.com/reference/android/database/Cursor)extras[Bundle](https://developer.android.com/reference/android/os/Bundle)to indicate total row count of recordset when paging is supported. Providers must include this when implementing paging support.

A provider may return -1 that row count of the recordset is unknown.

Providers having returned -1 in a previous query are recommended to send content change notification once (if) full recordset size becomes known.

<br />

Constant Value: "android.content.extra.TOTAL_COUNT"  

### NOTIFY_DELETE

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int NOTIFY_DELETE
```

Flag for[notifyChange(android.net.Uri, android.database.ContentObserver, int)](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20int)): typically set by a[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)to indicate that this notification is the result of a[ContentProvider.delete](https://developer.android.com/reference/android/content/ContentProvider#delete(android.net.Uri,%20android.os.Bundle))call.

Sending these detailed flags are optional, but providers are strongly recommended to send them.

<br />

Constant Value: 16 (0x00000010)  

### NOTIFY_INSERT

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int NOTIFY_INSERT
```

Flag for[notifyChange(android.net.Uri, android.database.ContentObserver, int)](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20int)): typically set by a[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)to indicate that this notification is the result of an[ContentProvider.insert](https://developer.android.com/reference/android/content/ContentProvider#insert(android.net.Uri,%20android.content.ContentValues))call.

Sending these detailed flags are optional, but providers are strongly recommended to send them.

<br />

Constant Value: 4 (0x00000004)  

### NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS
```

Flag for[notifyChange(android.net.Uri, android.database.ContentObserver, int)](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20int)): if set, this notification will be skipped if it is being delivered to the root URI of a ContentObserver that is using "notify for descendants." The purpose of this is to allow the provide to send a general notification of "something under X" changed that observers of that specific URI can receive, while also sending a specific URI under X. It would use this flag when sending the former, so that observers of "X and descendants" only see the latter.

<br />

Constant Value: 2 (0x00000002)  

### NOTIFY_SYNC_TO_NETWORK

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int NOTIFY_SYNC_TO_NETWORK
```

Flag for[notifyChange(android.net.Uri, android.database.ContentObserver, int)](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20int)): attempt to sync the change to the network.

<br />

Constant Value: 1 (0x00000001)  

### NOTIFY_UPDATE

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int NOTIFY_UPDATE
```

Flag for[notifyChange(android.net.Uri, android.database.ContentObserver, int)](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20int)): typically set by a[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)to indicate that this notification is the result of an[ContentProvider.update](https://developer.android.com/reference/android/content/ContentProvider#update(android.net.Uri,%20android.content.ContentValues,%20android.os.Bundle))call.

Sending these detailed flags are optional, but providers are strongly recommended to send them.

<br />

Constant Value: 8 (0x00000008)  

### QUERY_ARG_GROUP_COLUMNS

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String QUERY_ARG_GROUP_COLUMNS
```

Specifies the list of columns (stored as a`String[]`) against which to group results. When column values are identical, multiple records are collapsed together into a single record.

Columns present in this list must also be included in the projection supplied to[ContentResolver.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentResolver#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)).

Apps targeting[Build.VERSION_CODES.R](https://developer.android.com/reference/android/os/Build.VERSION_CODES#R)or higher:
- [ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)implementations: When preparing data in[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)), if group columns is reflected in the returned Cursor, it is strongly recommended that[QUERY_ARG_SORT_COLUMNS](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLUMNS)then be included in the array of honored arguments reflected in[Cursor](https://developer.android.com/reference/android/database/Cursor)extras[Bundle](https://developer.android.com/reference/android/os/Bundle)under[EXTRA_HONORED_ARGS](https://developer.android.com/reference/android/content/ContentResolver#EXTRA_HONORED_ARGS).
- When querying a provider, where no QUERY_ARG_SQL\* otherwise exists in the arguments[Bundle](https://developer.android.com/reference/android/os/Bundle), the Content framework will attempt to synthesize an QUERY_ARG_SQL\* argument using the corresponding QUERY_ARG_SORT\* values.

  <br />

  <br />

  Constant Value: "android:query-arg-group-columns"

### QUERY_ARG_LIMIT

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String QUERY_ARG_LIMIT
```

Specifies the max number of rows to include in a Cursor.

<br />

Constant Value: "android:query-arg-limit"  

### QUERY_ARG_OFFSET

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String QUERY_ARG_OFFSET
```

Specifies the offset row index within a Cursor.

<br />

Constant Value: "android:query-arg-offset"  

### QUERY_ARG_SORT_COLLATION

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String QUERY_ARG_SORT_COLLATION
```

Allows client to specify a hint to the provider declaring which collation to use when sorting values.

Providers may support custom collators. When specifying a custom collator the value is determined by the Provider.

[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)implementations: When preparing data in[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)), if sort collation is reflected in the returned Cursor, it is strongly recommended that[QUERY_ARG_SORT_COLLATION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLLATION)then be included in the array of honored arguments reflected in[Cursor](https://developer.android.com/reference/android/database/Cursor)extras[Bundle](https://developer.android.com/reference/android/os/Bundle)under[EXTRA_HONORED_ARGS](https://developer.android.com/reference/android/content/ContentResolver#EXTRA_HONORED_ARGS).

When querying a provider, where no QUERY_ARG_SQL\* otherwise exists in the arguments[Bundle](https://developer.android.com/reference/android/os/Bundle), the Content framework will attempt to synthesize a QUERY_ARG_SQL\* argument using the corresponding QUERY_ARG_SORT\* values.

<br />

**See also:**

- [Collator.PRIMARY](https://developer.android.com/reference/java/text/Collator#PRIMARY)
- [Collator.SECONDARY](https://developer.android.com/reference/java/text/Collator#SECONDARY)
- [Collator.TERTIARY](https://developer.android.com/reference/java/text/Collator#TERTIARY)
- [Collator.IDENTICAL](https://developer.android.com/reference/java/text/Collator#IDENTICAL)

Constant Value: "android:query-arg-sort-collation"  

### QUERY_ARG_SORT_COLUMNS

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String QUERY_ARG_SORT_COLUMNS
```

Specifies the list of columns (stored as a`String[]`) against which to sort results. When first column values are identical, records are then sorted based on second column values, and so on.

Columns present in this list must also be included in the projection supplied to[ContentResolver.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentResolver#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)).

Apps targeting[Build.VERSION_CODES.O](https://developer.android.com/reference/android/os/Build.VERSION_CODES#O)or higher:
- [ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)implementations: When preparing data in[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)), if sort columns is reflected in the returned Cursor, it is strongly recommended that[QUERY_ARG_SORT_COLUMNS](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLUMNS)then be included in the array of honored arguments reflected in[Cursor](https://developer.android.com/reference/android/database/Cursor)extras[Bundle](https://developer.android.com/reference/android/os/Bundle)under[EXTRA_HONORED_ARGS](https://developer.android.com/reference/android/content/ContentResolver#EXTRA_HONORED_ARGS).
- When querying a provider, where no QUERY_ARG_SQL\* otherwise exists in the arguments[Bundle](https://developer.android.com/reference/android/os/Bundle), the Content framework will attempt to synthesize a QUERY_ARG_SQL\* argument using the corresponding QUERY_ARG_SORT\* values.

  <br />

  <br />

  Constant Value: "android:query-arg-sort-columns"

### QUERY_ARG_SORT_DIRECTION

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String QUERY_ARG_SORT_DIRECTION
```

Specifies desired sort order. When unspecified a provider may provide a default sort direction, or choose to return unsorted results.

Apps targeting[Build.VERSION_CODES.O](https://developer.android.com/reference/android/os/Build.VERSION_CODES#O)or higher:
- [ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)implementations: When preparing data in[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)), if sort direction is reflected in the returned Cursor, it is strongly recommended that[QUERY_ARG_SORT_DIRECTION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_DIRECTION)then be included in the array of honored arguments reflected in[Cursor](https://developer.android.com/reference/android/database/Cursor)extras[Bundle](https://developer.android.com/reference/android/os/Bundle)under[EXTRA_HONORED_ARGS](https://developer.android.com/reference/android/content/ContentResolver#EXTRA_HONORED_ARGS).
- When querying a provider, where no QUERY_ARG_SQL\* otherwise exists in the arguments[Bundle](https://developer.android.com/reference/android/os/Bundle), the Content framework will attempt to synthesize a QUERY_ARG_SQL\* argument using the corresponding QUERY_ARG_SORT\* values.

  <br />

  <br />

  **See also:**
  - [QUERY_SORT_DIRECTION_ASCENDING](https://developer.android.com/reference/android/content/ContentResolver#QUERY_SORT_DIRECTION_ASCENDING)
  - [QUERY_SORT_DIRECTION_DESCENDING](https://developer.android.com/reference/android/content/ContentResolver#QUERY_SORT_DIRECTION_DESCENDING)

  Constant Value: "android:query-arg-sort-direction"

### QUERY_ARG_SORT_LOCALE

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String QUERY_ARG_SORT_LOCALE
```

Allows client to specify a hint to the provider declaring which locale to use when sorting values.

The value is defined as a RFC 3066 locale ID followed by an optional keyword list, which is the locale format used to configure ICU through classes like[ULocale](https://developer.android.com/reference/android/icu/util/ULocale). This supports requesting advanced sorting options, such as`de@collation=phonebook`,`zh@collation=pinyin`, etc.

[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)implementations: When preparing data in[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)), if sort locale is reflected in the returned Cursor, it is strongly recommended that[QUERY_ARG_SORT_LOCALE](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_LOCALE)then be included in the array of honored arguments reflected in[Cursor](https://developer.android.com/reference/android/database/Cursor)extras[Bundle](https://developer.android.com/reference/android/os/Bundle)under[EXTRA_HONORED_ARGS](https://developer.android.com/reference/android/content/ContentResolver#EXTRA_HONORED_ARGS).

<br />

**See also:**

- [Locale.Locale(String)](https://developer.android.com/reference/java/util/Locale#Locale(java.lang.String))
- [ULocale.ULocale(String)](https://developer.android.com/reference/android/icu/util/ULocale#ULocale(java.lang.String))

Constant Value: "android:query-arg-sort-locale"  

### QUERY_ARG_SQL_GROUP_BY

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String QUERY_ARG_SQL_GROUP_BY
```

Key for an SQL style`GROUP BY`string that may be present in the query Bundle argument passed to[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)).

**Apps targeting[Build.VERSION_CODES.O](https://developer.android.com/reference/android/os/Build.VERSION_CODES#O)or higher are strongly encourage to use structured query arguments in lieu of opaque SQL query clauses.**

<br />

**See also:**

- [QUERY_ARG_GROUP_COLUMNS](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_GROUP_COLUMNS)

Constant Value: "android:query-arg-sql-group-by"  

### QUERY_ARG_SQL_HAVING

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String QUERY_ARG_SQL_HAVING
```

Key for an SQL style`HAVING`string that may be present in the query Bundle argument passed to[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)).

**Apps targeting[Build.VERSION_CODES.O](https://developer.android.com/reference/android/os/Build.VERSION_CODES#O)or higher are strongly encourage to use structured query arguments in lieu of opaque SQL query clauses.**

<br />

Constant Value: "android:query-arg-sql-having"  

### QUERY_ARG_SQL_LIMIT

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String QUERY_ARG_SQL_LIMIT
```

Key for an SQL style`LIMIT`string that may be present in the query Bundle argument passed to[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)).

**Apps targeting[Build.VERSION_CODES.O](https://developer.android.com/reference/android/os/Build.VERSION_CODES#O)or higher are strongly encourage to use structured query arguments in lieu of opaque SQL query clauses.**

<br />

**See also:**

- [QUERY_ARG_LIMIT](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_LIMIT)
- [QUERY_ARG_OFFSET](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_OFFSET)

Constant Value: "android:query-arg-sql-limit"  

### QUERY_ARG_SQL_SELECTION

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String QUERY_ARG_SQL_SELECTION
```

Key for an SQL style selection string that may be present in the query Bundle argument passed to[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal))when called by a legacy client.

Clients should never include user supplied values directly in the selection string, as this presents an avenue for SQL injection attacks. In lieu of this, a client should use standard placeholder notation to represent values in a selection string, then supply a corresponding value in[.QUERY_ARG_SQL_SELECTION_ARGS](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SQL_SELECTION_ARGS).

**Apps targeting[Build.VERSION_CODES.O](https://developer.android.com/reference/android/os/Build.VERSION_CODES#O)or higher are strongly encourage to use structured query arguments in lieu of opaque SQL query clauses.**

<br />

**See also:**

- [QUERY_ARG_SORT_COLUMNS](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLUMNS)
- [QUERY_ARG_SORT_DIRECTION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_DIRECTION)
- [QUERY_ARG_SORT_COLLATION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLLATION)
- [QUERY_ARG_SORT_LOCALE](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_LOCALE)

Constant Value: "android:query-arg-sql-selection"  

### QUERY_ARG_SQL_SELECTION_ARGS

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String QUERY_ARG_SQL_SELECTION_ARGS
```

Key for SQL selection string arguments list.

Clients should never include user supplied values directly in the selection string, as this presents an avenue for SQL injection attacks. In lieu of this, a client should use standard placeholder notation to represent values in a selection string, then supply a corresponding value in[.QUERY_ARG_SQL_SELECTION_ARGS](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SQL_SELECTION_ARGS).

**Apps targeting[Build.VERSION_CODES.O](https://developer.android.com/reference/android/os/Build.VERSION_CODES#O)or higher are strongly encourage to use structured query arguments in lieu of opaque SQL query clauses.**

<br />

**See also:**

- [QUERY_ARG_SORT_COLUMNS](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLUMNS)
- [QUERY_ARG_SORT_DIRECTION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_DIRECTION)
- [QUERY_ARG_SORT_COLLATION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLLATION)
- [QUERY_ARG_SORT_LOCALE](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_LOCALE)

Constant Value: "android:query-arg-sql-selection-args"  

### QUERY_ARG_SQL_SORT_ORDER

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String QUERY_ARG_SQL_SORT_ORDER
```

Key for an SQL style sort string that may be present in the query Bundle argument passed to[ContentProvider.query(Uri, String[], Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentProvider#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal))when called by a legacy client.

**Apps targeting[Build.VERSION_CODES.O](https://developer.android.com/reference/android/os/Build.VERSION_CODES#O)or higher are strongly encourage to use structured query arguments in lieu of opaque SQL query clauses.**

<br />

**See also:**

- [QUERY_ARG_SORT_COLUMNS](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLUMNS)
- [QUERY_ARG_SORT_DIRECTION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_DIRECTION)
- [QUERY_ARG_SORT_COLLATION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLLATION)
- [QUERY_ARG_SORT_LOCALE](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_LOCALE)

Constant Value: "android:query-arg-sql-sort-order"  

### QUERY_SORT_DIRECTION_ASCENDING

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int QUERY_SORT_DIRECTION_ASCENDING
```

<br />

<br />

Constant Value: 0 (0x00000000)  

### QUERY_SORT_DIRECTION_DESCENDING

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int QUERY_SORT_DIRECTION_DESCENDING
```

<br />

<br />

Constant Value: 1 (0x00000001)  

### SCHEME_ANDROID_RESOURCE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SCHEME_ANDROID_RESOURCE
```

<br />

<br />

Constant Value: "android.resource"  

### SCHEME_CONTENT

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SCHEME_CONTENT
```

<br />

<br />

Constant Value: "content"  

### SCHEME_FILE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SCHEME_FILE
```

<br />

<br />

Constant Value: "file"  

### SYNC_EXTRAS_ACCOUNT

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SYNC_EXTRAS_ACCOUNT
```

<br />

**This constant was deprecated in API level 15.**   
instead use[requestSync(android.accounts.Account, java.lang.String, android.os.Bundle)](https://developer.android.com/reference/android/content/ContentResolver#requestSync(android.accounts.Account,%20java.lang.String,%20android.os.Bundle))

<br />

<br />

Constant Value: "account"  

### SYNC_EXTRAS_DISCARD_LOCAL_DELETIONS

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SYNC_EXTRAS_DISCARD_LOCAL_DELETIONS
```

Indicates that the sync adapter should not proceed with the delete operations, if it determines that there are too many. See[SyncResult.tooManyDeletions](https://developer.android.com/reference/android/content/SyncResult#tooManyDeletions)

<br />

Constant Value: "discard_deletions"  

### SYNC_EXTRAS_DO_NOT_RETRY

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SYNC_EXTRAS_DO_NOT_RETRY
```

If this extra is set to true then the request will not be retried if it fails.

<br />

Constant Value: "do_not_retry"  

### SYNC_EXTRAS_EXPEDITED

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SYNC_EXTRAS_EXPEDITED
```

If this extra is set to true, the sync request will be scheduled at the front of the sync request queue, but it is still subject to JobScheduler quota and throttling due to App Standby buckets.

This is different from[SYNC_EXTRAS_SCHEDULE_AS_EXPEDITED_JOB](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_SCHEDULE_AS_EXPEDITED_JOB).

<br />

Constant Value: "expedited"  

### SYNC_EXTRAS_FORCE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SYNC_EXTRAS_FORCE
```

<br />

**This constant was deprecated in API level 15.**   
instead use[SYNC_EXTRAS_MANUAL](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_MANUAL)

<br />

<br />

Constant Value: "force"  

### SYNC_EXTRAS_IGNORE_BACKOFF

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SYNC_EXTRAS_IGNORE_BACKOFF
```

If this extra is set to true then any backoffs for the initial attempt (e.g. due to retries) are ignored by the sync scheduler. If this request fails and gets rescheduled then the retries will still honor the backoff.

<br />

Constant Value: "ignore_backoff"  

### SYNC_EXTRAS_IGNORE_SETTINGS

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SYNC_EXTRAS_IGNORE_SETTINGS
```

If this extra is set to true then the sync settings (like getSyncAutomatically()) are ignored by the sync scheduler.

<br />

Constant Value: "ignore_settings"  

### SYNC_EXTRAS_INITIALIZE

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SYNC_EXTRAS_INITIALIZE
```

Set by the SyncManager to request that the SyncAdapter initialize itself for the given account/authority pair. One required initialization step is to ensure that[setIsSyncable(android.accounts.Account, java.lang.String, int)](https://developer.android.com/reference/android/content/ContentResolver#setIsSyncable(android.accounts.Account,%20java.lang.String,%20int))has been called with a \>= 0 value. When this flag is set the SyncAdapter does not need to do a full sync, though it is allowed to do so.

<br />

Constant Value: "initialize"  

### SYNC_EXTRAS_MANUAL

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SYNC_EXTRAS_MANUAL
```

Setting this extra is the equivalent of setting both[SYNC_EXTRAS_IGNORE_SETTINGS](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_IGNORE_SETTINGS)and[SYNC_EXTRAS_IGNORE_BACKOFF](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_IGNORE_BACKOFF)

<br />

Constant Value: "force"  

### SYNC_EXTRAS_OVERRIDE_TOO_MANY_DELETIONS

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SYNC_EXTRAS_OVERRIDE_TOO_MANY_DELETIONS
```

Indicates that the sync adapter should proceed with the delete operations, even if it determines that there are too many. See[SyncResult.tooManyDeletions](https://developer.android.com/reference/android/content/SyncResult#tooManyDeletions)

<br />

Constant Value: "deletions_override"  

### SYNC_EXTRAS_REQUIRE_CHARGING

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SYNC_EXTRAS_REQUIRE_CHARGING
```

If this extra is set to true, the sync request will be scheduled only when the device is plugged in. This is equivalent to calling setRequiresCharging(true) on[SyncRequest](https://developer.android.com/reference/android/content/SyncRequest).

<br />

Constant Value: "require_charging"  

### SYNC_EXTRAS_SCHEDULE_AS_EXPEDITED_JOB

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SYNC_EXTRAS_SCHEDULE_AS_EXPEDITED_JOB
```

Run this sync operation as an "expedited job" (see[JobInfo.Builder.setExpedited(boolean)](https://developer.android.com/reference/android/app/job/JobInfo.Builder#setExpedited(boolean))). Normally (if this flag isn't specified), sync operations are executed as regular[JobService](https://developer.android.com/reference/android/app/job/JobService)jobs.

Because Expedited Jobs have various restrictions compared to regular jobs, this flag cannot be combined with certain other flags, otherwise an`IllegalArgumentException`will be thrown. Notably, because Expedited Jobs do not support various constraints, the following restriction apply:

- Can't be used with[SYNC_EXTRAS_REQUIRE_CHARGING](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_REQUIRE_CHARGING)
- Can't be used with[SYNC_EXTRAS_EXPEDITED](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_EXPEDITED)
- Can't be used on periodic syncs.
- When an expedited-job-sync fails and a retry is scheduled, the retried sync will be scheduled as a regular job unless[SYNC_EXTRAS_IGNORE_BACKOFF](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_IGNORE_BACKOFF)is set.

This is different from[SYNC_EXTRAS_EXPEDITED](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_EXPEDITED).

<br />

Constant Value: "schedule_as_expedited_job"  

### SYNC_EXTRAS_UPLOAD

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String SYNC_EXTRAS_UPLOAD
```

Indicates that this sync is intended to only upload local changes to the server. For example, this will be set to true if the sync is initiated by a call to[ContentResolver.notifyChange(android.net.Uri, android.database.ContentObserver, boolean)](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20boolean))

<br />

Constant Value: "upload"  

### SYNC_OBSERVER_TYPE_ACTIVE

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int SYNC_OBSERVER_TYPE_ACTIVE
```

<br />

<br />

Constant Value: 4 (0x00000004)  

### SYNC_OBSERVER_TYPE_PENDING

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int SYNC_OBSERVER_TYPE_PENDING
```

<br />

<br />

Constant Value: 2 (0x00000002)  

### SYNC_OBSERVER_TYPE_SETTINGS

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int SYNC_OBSERVER_TYPE_SETTINGS
```

<br />

<br />

Constant Value: 1 (0x00000001)

## Public constructors

### ContentResolver

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public ContentResolver (Context context)
```

Note: passing a`null`context here could lead to unexpected behavior in certain ContentResolver APIs so it is highly recommended to pass a non-null context here.

<br />

|                      Parameters                       ||
|-----------|--------------------------------------------|
| `context` | `Context`: This value may be`null`. <br /> |

## Public methods

### acquireContentProviderClient

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final ContentProviderClient acquireContentProviderClient (Uri uri)
```

Returns a[ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient)that is associated with the[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)that services the content at uri, starting the provider if necessary. Returns null if there is no provider associated wih the uri. The caller must indicate that they are done with the provider by calling[ContentProviderClient.release](https://developer.android.com/reference/android/content/ContentProviderClient#release())which will allow the system to release the provider if it determines that there is no other reason for keeping it active.

<br />

|                                          Parameters                                          ||
|-------|---------------------------------------------------------------------------------------|
| `uri` | `Uri`: specifies which provider should be acquired This value cannot be`null`. <br /> |

|                                                                                                                                                                                                 Returns                                                                                                                                                                                                 ||
|--------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient) | a[ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient)that is associated with the[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)that services the content at uri or null if there isn't one. <br /> |

### acquireContentProviderClient

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final ContentProviderClient acquireContentProviderClient (String name)
```

Returns a[ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient)that is associated with the[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)with the authority of name, starting the provider if necessary. Returns null if there is no provider associated wih the uri. The caller must indicate that they are done with the provider by calling[ContentProviderClient.release](https://developer.android.com/reference/android/content/ContentProviderClient#release())which will allow the system to release the provider if it determines that there is no other reason for keeping it active.

<br />

|                                            Parameters                                            ||
|--------|------------------------------------------------------------------------------------------|
| `name` | `String`: specifies which provider should be acquired This value cannot be`null`. <br /> |

|                                                                                                                                                                                              Returns                                                                                                                                                                                              ||
|--------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient) | a[ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient)that is associated with the[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)with the authority of name or null if there isn't one. <br /> |

### acquireUnstableContentProviderClient

Added in[API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final ContentProviderClient acquireUnstableContentProviderClient (String name)
```

Like[acquireContentProviderClient(java.lang.String)](https://developer.android.com/reference/android/content/ContentResolver#acquireContentProviderClient(java.lang.String)), but for use when you do not trust the stability of the target content provider. This turns off the mechanism in the platform clean up processes that are dependent on a content provider if that content provider's process goes away. Normally you can safely assume that once you have acquired a provider, you can freely use it as needed and it won't disappear, even if your process is in the background. If using this method, you need to take care to deal with any failures when communicating with the provider, and be sure to close it so that it can be re-opened later. In particular, catching a[DeadObjectException](https://developer.android.com/reference/android/os/DeadObjectException)from the calls there will let you know that the content provider has gone away; at that point the current ContentProviderClient object is invalid, and you should release it. You can acquire a new one if you would like to try to restart the provider and perform new operations on it.

<br />

|                      Parameters                      ||
|--------|----------------------------------------------|
| `name` | `String`: This value cannot be`null`. <br /> |

|                                                                 Returns                                                                 ||
|--------------------------------------------------------------------------------------------------------|---------------------------------|
| [ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient) | This value may be`null`. <br /> |

### acquireUnstableContentProviderClient

Added in[API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final ContentProviderClient acquireUnstableContentProviderClient (Uri uri)
```

Like[acquireContentProviderClient(android.net.Uri)](https://developer.android.com/reference/android/content/ContentResolver#acquireContentProviderClient(android.net.Uri)), but for use when you do not trust the stability of the target content provider. This turns off the mechanism in the platform clean up processes that are dependent on a content provider if that content provider's process goes away. Normally you can safely assume that once you have acquired a provider, you can freely use it as needed and it won't disappear, even if your process is in the background. If using this method, you need to take care to deal with any failures when communicating with the provider, and be sure to close it so that it can be re-opened later. In particular, catching a[DeadObjectException](https://developer.android.com/reference/android/os/DeadObjectException)from the calls there will let you know that the content provider has gone away; at that point the current ContentProviderClient object is invalid, and you should release it. You can acquire a new one if you would like to try to restart the provider and perform new operations on it.

<br />

|                    Parameters                    ||
|-------|-------------------------------------------|
| `uri` | `Uri`: This value cannot be`null`. <br /> |

|                                                                 Returns                                                                 ||
|--------------------------------------------------------------------------------------------------------|---------------------------------|
| [ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient) | This value may be`null`. <br /> |

### addPeriodicSync

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static void addPeriodicSync (Account account, 
                String authority, 
                Bundle extras, 
                long pollFrequency)
```

Specifies that a sync should be requested with the specified the account, authority, and extras at the given frequency. If there is already another periodic sync scheduled with the account, authority and extras then a new periodic sync won't be added, instead the frequency of the previous one will be updated.

These periodic syncs honor the "syncAutomatically" and "masterSyncAutomatically" settings. Although these sync are scheduled at the specified frequency, it may take longer for it to actually be started if other syncs are ahead of it in the sync operation queue. This means that the actual start time may drift.

Periodic syncs are not allowed to have any of[SYNC_EXTRAS_DO_NOT_RETRY](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_DO_NOT_RETRY),[SYNC_EXTRAS_IGNORE_BACKOFF](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_IGNORE_BACKOFF),[SYNC_EXTRAS_IGNORE_SETTINGS](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_IGNORE_SETTINGS),[SYNC_EXTRAS_INITIALIZE](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_INITIALIZE),[SYNC_EXTRAS_FORCE](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_FORCE),[SYNC_EXTRAS_EXPEDITED](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_EXPEDITED),[SYNC_EXTRAS_MANUAL](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_MANUAL),[SYNC_EXTRAS_SCHEDULE_AS_EXPEDITED_JOB](https://developer.android.com/reference/android/content/ContentResolver#SYNC_EXTRAS_SCHEDULE_AS_EXPEDITED_JOB)set to true. If any are supplied then an[IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException)will be thrown.

This method requires the caller to hold the permission[Manifest.permission.WRITE_SYNC_SETTINGS](https://developer.android.com/reference/android/Manifest.permission#WRITE_SYNC_SETTINGS).

The bundle for a periodic sync can be queried by applications with the correct permissions using[ContentResolver.getPeriodicSyncs(Account account, String provider)](https://developer.android.com/reference/android/content/ContentResolver#getPeriodicSyncs(android.accounts.Account,%20java.lang.String)), so no sensitive data should be transferred here.

<br />

|                                                                                                           Parameters                                                                                                            ||
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `account`       | `Account`: the account to specify in the sync <br />                                                                                                                                                           |
| `authority`     | `String`: the provider to specify in the sync request <br />                                                                                                                                                   |
| `extras`        | `Bundle`: extra parameters to go along with the sync request <br />                                                                                                                                            |
| `pollFrequency` | `long`: how frequently the sync should be performed, in seconds. On Android API level 24 and above, a minimum interval of 15 minutes is enforced. On previous versions, the minimum interval is 1 hour. <br /> |

|                                                                                  Throws                                                                                   ||
|--------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) | if an illegal extra was set or if any of the parameters are null. |

### addStatusChangeListener

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static Object addStatusChangeListener (int mask, 
                SyncStatusObserver callback)
```

Request notifications when the different aspects of the SyncManager change. The different items that can be requested are:

- [SYNC_OBSERVER_TYPE_PENDING](https://developer.android.com/reference/android/content/ContentResolver#SYNC_OBSERVER_TYPE_PENDING)
- [SYNC_OBSERVER_TYPE_ACTIVE](https://developer.android.com/reference/android/content/ContentResolver#SYNC_OBSERVER_TYPE_ACTIVE)
- [SYNC_OBSERVER_TYPE_SETTINGS](https://developer.android.com/reference/android/content/ContentResolver#SYNC_OBSERVER_TYPE_SETTINGS)

The caller can set one or more of the status types in the mask for any given listener registration.

<br />

<br />

|                                          Parameters                                          ||
|------------|----------------------------------------------------------------------------------|
| `mask`     | `int`: the status change types that will cause the callback to be invoked <br /> |
| `callback` | `SyncStatusObserver`: observer to be invoked when the status changes <br />      |

|                                                                   Returns                                                                   ||
|--------------------------------------------------------------------|-------------------------------------------------------------------------|
| [Object](https://developer.android.com/reference/java/lang/Object) | a handle that can be used to remove the listener at a later time <br /> |

### applyBatch

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public ContentProviderResult[] applyBatch (String authority, 
                ArrayList<ContentProviderOperation> operations)
```

Applies each of the[ContentProviderOperation](https://developer.android.com/reference/android/content/ContentProviderOperation)objects and returns an array of their results. Passes through OperationApplicationException, which may be thrown by the call to[ContentProviderOperation.apply](https://developer.android.com/reference/android/content/ContentProviderOperation#apply(android.content.ContentProvider,%20android.content.ContentProviderResult[],%20int)). If all the applications succeed then a[ContentProviderResult](https://developer.android.com/reference/android/content/ContentProviderResult)array with the same number of elements as the operations will be returned. It is implementation-specific how many, if any, operations will have been successfully applied if a call to apply results in a[OperationApplicationException](https://developer.android.com/reference/android/content/OperationApplicationException).

<br />

|                                                              Parameters                                                               ||
|--------------|-------------------------------------------------------------------------------------------------------------------------|
| `authority`  | `String`: the authority of the ContentProvider to which this batch should be applied This value cannot be`null`. <br /> |
| `operations` | `ArrayList`: the operations to apply This value cannot be`null`. <br />                                                 |

|                                                                                   Returns                                                                                    ||
|----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
| [ContentProviderResult[]](https://developer.android.com/reference/android/content/ContentProviderResult) | the results of the applications This value cannot be`null`. <br /> |

|                                                                                                                                                                                           Throws                                                                                                                                                                                            ||
|------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [OperationApplicationException](https://developer.android.com/reference/android/content/OperationApplicationException) | thrown if an application fails. See[ContentProviderOperation.apply](https://developer.android.com/reference/android/content/ContentProviderOperation#apply(android.content.ContentProvider,%20android.content.ContentProviderResult[],%20int))for more information. |
| [RemoteException](https://developer.android.com/reference/android/os/RemoteException)                                  | thrown if a RemoteException is encountered while attempting to communicate with a remote provider.                                                                                                                                                                  |

### bulkInsert

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int bulkInsert (Uri url, 
                ContentValues[] values)
```

Inserts multiple rows into a table at the given URL. This function make no guarantees about the atomicity of the insertions.

<br />

|                                                                             Parameters                                                                             ||
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `url`    | `Uri`: The URL of the table to insert into. This value cannot be`null`. <br />                                                                           |
| `values` | `ContentValues`: The initial values for the newly inserted rows. The key is the column name for the field. Passing null will create an empty row. <br /> |

|                     Returns                     ||
|-------|------------------------------------------|
| `int` | the number of newly created rows. <br /> |

### call

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Bundle call (Uri uri, 
                String method, 
                String arg, 
                Bundle extras)
```

Call a provider-defined method. This can be used to implement read or write interfaces which are cheaper than using a Cursor and/or do not fit into the traditional table model.

<br />

|                                                 Parameters                                                  ||
|----------|---------------------------------------------------------------------------------------------------|
| `uri`    | `Uri`: This value cannot be`null`. <br />                                                         |
| `method` | `String`: provider-defined method name to call. Opaque to framework, but must be non-null. <br /> |
| `arg`    | `String`: provider-defined String argument. May be null. <br />                                   |
| `extras` | `Bundle`: provider-defined Bundle argument. May be null. <br />                                   |

|                                                                                 Returns                                                                                  ||
|---------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| [Bundle](https://developer.android.com/reference/android/os/Bundle) | a result Bundle, possibly null. Will be null if the ContentProvider does not implement call. <br /> |

|                                                              Throws                                                              ||
|--------------------------------------------------------------------------------------------------------|--------------------------|
| [NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException)         | if uri or method is null |
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) | if uri is not known      |

### call

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Bundle call (String authority, 
                String method, 
                String arg, 
                Bundle extras)
```

<br />

<br />

|                        Parameters                         ||
|-------------|----------------------------------------------|
| `authority` | `String`: This value cannot be`null`. <br /> |
| `method`    | `String`: This value cannot be`null`. <br /> |
| `arg`       | `String`: This value may be`null`. <br />    |
| `extras`    | `Bundle`: This value may be`null`. <br />    |

|                                               Returns                                                ||
|---------------------------------------------------------------------|---------------------------------|
| [Bundle](https://developer.android.com/reference/android/os/Bundle) | This value may be`null`. <br /> |

### cancelSync

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void cancelSync (Uri uri)
```

<br />

**This method was deprecated in API level 15.**   
instead use[cancelSync(android.accounts.Account, java.lang.String)](https://developer.android.com/reference/android/content/ContentResolver#cancelSync(android.accounts.Account,%20java.lang.String))

Cancel any active or pending syncs that match the Uri. If the uri is null then all syncs will be canceled.

<br />

|                                     Parameters                                      ||
|-------|------------------------------------------------------------------------------|
| `uri` | `Uri`: the uri of the provider to sync or null to sync all providers. <br /> |

### cancelSync

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static void cancelSync (SyncRequest request)
```

Remove the specified sync. This will cancel any pending or active syncs. If the request is for a periodic sync, this call will remove any future occurrences.

If a periodic sync is specified, the caller must hold the permission[Manifest.permission.WRITE_SYNC_SETTINGS](https://developer.android.com/reference/android/Manifest.permission#WRITE_SYNC_SETTINGS).
It is possible to cancel a sync using a SyncRequest object that is not the same object with which you requested the sync. Do so by building a SyncRequest with the same adapter, frequency,**and** extras bundle.

<br />

<br />

|                                            Parameters                                            ||
|-----------|---------------------------------------------------------------------------------------|
| `request` | `SyncRequest`: SyncRequest object containing information about sync to cancel. <br /> |

### cancelSync

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static void cancelSync (Account account, 
                String authority)
```

Cancel any active or pending syncs that match account and authority. The account and authority can each independently be set to null, which means that syncs with any account or authority, respectively, will match.

<br />

|                                  Parameters                                  ||
|-------------|-----------------------------------------------------------------|
| `account`   | `Account`: filters the syncs that match by this account <br />  |
| `authority` | `String`: filters the syncs that match by this authority <br /> |

### canonicalize

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Uri canonicalize (Uri url)
```

Transform the given<var translate="no">url</var>to a canonical representation of its referenced resource, which can be used across devices, persisted, backed up and restored, etc. The returned Uri is still a fully capable Uri for use with its content provider, allowing you to do all of the same content provider operations as with the original Uri --[query(Uri, String, Bundle, CancellationSignal)](https://developer.android.com/reference/android/content/ContentResolver#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)),[openInputStream(android.net.Uri)](https://developer.android.com/reference/android/content/ContentResolver#openInputStream(android.net.Uri)), etc. The only difference in behavior between the original and new Uris is that the content provider may need to do some additional work at each call using it to resolve it to the correct resource, especially if the canonical Uri has been moved to a different environment.

If you are moving a canonical Uri between environments, you should perform another call to[canonicalize(Uri)](https://developer.android.com/reference/android/content/ContentResolver#canonicalize(android.net.Uri))with that original Uri to re-canonicalize it for the current environment. Alternatively, you may want to use[uncanonicalize(Uri)](https://developer.android.com/reference/android/content/ContentResolver#uncanonicalize(android.net.Uri))to transform it to a non-canonical Uri that works only in the current environment but potentially more efficiently than the canonical representation.

<br />

<br />

|                                                                                                                          Parameters                                                                                                                           ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `url` | `Uri`: The[Uri](https://developer.android.com/reference/android/net/Uri)that is to be transformed to a canonical representation. Like all resolver calls, the input can be either a non-canonical or canonical Uri. This value cannot be`null`. <br /> |

|                                                                                                                                                              Returns                                                                                                                                                              ||
|----------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Uri](https://developer.android.com/reference/android/net/Uri) | Returns the official canonical representation of<var translate="no">url</var>, or null if the content provider does not support a canonical representation of the given Uri. Many providers may not support canonicalization of some or all of their Uris. <br /> |

**See also:**

- [uncanonicalize(Uri)](https://developer.android.com/reference/android/content/ContentResolver#uncanonicalize(android.net.Uri))  

### delete

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int delete (Uri url, 
                String where, 
                String[] selectionArgs)
```

Deletes row(s) specified by a content URI. If the content provider supports transactions, the deletion will be atomic.

<br />

|                                                                              Parameters                                                                              ||
|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `url`           | `Uri`: The URL of the row to delete. This value cannot be`null`. <br />                                                                             |
| `where`         | `String`: A filter to apply to rows before deleting, formatted as an SQL WHERE clause (excluding the WHERE itself). This value may be`null`. <br /> |
| `selectionArgs` | `String`: This value may be`null`. <br />                                                                                                           |

|                  Returns                  ||
|-------|------------------------------------|
| `int` | The number of rows deleted. <br /> |

### delete

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int delete (Uri url, 
                Bundle extras)
```

Deletes row(s) specified by a content URI. If the content provider supports transactions, the deletion will be atomic.

<br />

|                                                                                                                                                                                                         Parameters                                                                                                                                                                                                         ||
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `url`    | `Uri`: The URL of the row to delete. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                          |
| `extras` | `Bundle`: A Bundle containing additional information necessary for the operation. Arguments may include SQL style arguments, such as[ContentResolver.QUERY_ARG_SQL_LIMIT](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SQL_LIMIT), but note that the documentation for each individual provider will indicate which arguments they support. This value may be`null`. <br /> |

|                  Returns                  ||
|-------|------------------------------------|
| `int` | The number of rows deleted. <br /> |

|                                                                                     Throws                                                                                     ||
|--------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) | if the provider doesn't support one of the requested Bundle arguments. |

### getCurrentSync

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static SyncInfo getCurrentSync ()
```

<br />

**This method was deprecated in API level 15.**   
Since multiple concurrent syncs are now supported you should use[getCurrentSyncs()](https://developer.android.com/reference/android/content/ContentResolver#getCurrentSyncs())to get the accurate list of current syncs. This method returns the first item from the list of current syncs or null if there are none.

If a sync is active returns the information about it, otherwise returns null.

This method requires the caller to hold the permission[Manifest.permission.READ_SYNC_STATS](https://developer.android.com/reference/android/Manifest.permission#READ_SYNC_STATS).

<br />

<br />

|                                                                            Returns                                                                            ||
|------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| [SyncInfo](https://developer.android.com/reference/android/content/SyncInfo) | the SyncInfo for the currently active sync or null if one is not active. <br /> |

### getCurrentSyncs

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static List<SyncInfo> getCurrentSyncs ()
```

Returns a list with information about all the active syncs. This list will be empty if there are no active syncs.

This method requires the caller to hold the permission[Manifest.permission.READ_SYNC_STATS](https://developer.android.com/reference/android/Manifest.permission#READ_SYNC_STATS).

<br />

<br />

|                                                                                                       Returns                                                                                                       ||
|--------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| [List](https://developer.android.com/reference/java/util/List)`<`[SyncInfo](https://developer.android.com/reference/android/content/SyncInfo)`>` | a List of SyncInfo objects for the currently active syncs. <br /> |

### getIsSyncable

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static int getIsSyncable (Account account, 
                String authority)
```

Check if this account/provider is syncable.

This method requires the caller to hold the permission[Manifest.permission.READ_SYNC_SETTINGS](https://developer.android.com/reference/android/Manifest.permission#READ_SYNC_SETTINGS).

<br />

|          Parameters           ||
|-------------|------------------|
| `account`   | `Account` <br /> |
| `authority` | `String` <br />  |

|                                       Returns                                        ||
|-------|-------------------------------------------------------------------------------|
| `int` | \>0 if it is syncable, 0 if not, and \<0 if the state isn't known yet. <br /> |

### getMasterSyncAutomatically

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static boolean getMasterSyncAutomatically ()
```

Gets the global auto-sync setting that applies to all the providers and accounts. If this is false then the per-provider auto-sync setting is ignored.

This method requires the caller to hold the permission[Manifest.permission.READ_SYNC_SETTINGS](https://developer.android.com/reference/android/Manifest.permission#READ_SYNC_SETTINGS).

<br />

|                                            Returns                                            ||
|-----------|------------------------------------------------------------------------------------|
| `boolean` | the global auto-sync setting that applies to all the providers and accounts <br /> |

### getOutgoingPersistedUriPermissions

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public List<UriPermission> getOutgoingPersistedUriPermissions ()
```

Return list of all persisted URI permission grants that are hosted by the calling app. That is, the returned permissions have been granted*from* the calling app. Only grants taken with[takePersistableUriPermission(android.net.Uri, int)](https://developer.android.com/reference/android/content/ContentResolver#takePersistableUriPermission(android.net.Uri,%20int))are returned.

Note: Some of the returned URIs may not be usable until after the user is unlocked.

<br />

|                                                                                            Returns                                                                                             ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [List](https://developer.android.com/reference/java/util/List)`<`[UriPermission](https://developer.android.com/reference/android/content/UriPermission)`>` | This value cannot be`null`. <br /> |

### getPeriodicSyncs

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static List<PeriodicSync> getPeriodicSyncs (Account account, 
                String authority)
```

Get the list of information about the periodic syncs for the given account and authority.

This method requires the caller to hold the permission[Manifest.permission.READ_SYNC_SETTINGS](https://developer.android.com/reference/android/Manifest.permission#READ_SYNC_SETTINGS).

<br />

|                                   Parameters                                    ||
|-------------|--------------------------------------------------------------------|
| `account`   | `Account`: the account whose periodic syncs we are querying <br /> |
| `authority` | `String`: the provider whose periodic syncs we are querying <br /> |

|                                                                                                                     Returns                                                                                                                     ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| [List](https://developer.android.com/reference/java/util/List)`<`[PeriodicSync](https://developer.android.com/reference/android/content/PeriodicSync)`>` | a list of PeriodicSync objects. This list may be empty but will never be null. <br /> |

### getPersistedUriPermissions

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public List<UriPermission> getPersistedUriPermissions ()
```

Return list of all URI permission grants that have been persisted by the calling app. That is, the returned permissions have been granted*to* the calling app. Only persistable grants taken with[takePersistableUriPermission(android.net.Uri, int)](https://developer.android.com/reference/android/content/ContentResolver#takePersistableUriPermission(android.net.Uri,%20int))are returned.

Note: Some of the returned URIs may not be usable until after the user is unlocked.

<br />

|                                                                                            Returns                                                                                             ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [List](https://developer.android.com/reference/java/util/List)`<`[UriPermission](https://developer.android.com/reference/android/content/UriPermission)`>` | This value cannot be`null`. <br /> |

**See also:**

- [takePersistableUriPermission(Uri, int)](https://developer.android.com/reference/android/content/ContentResolver#takePersistableUriPermission(android.net.Uri,%20int))
- [releasePersistableUriPermission(Uri, int)](https://developer.android.com/reference/android/content/ContentResolver#releasePersistableUriPermission(android.net.Uri,%20int))  

### getStreamTypes

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public String[] getStreamTypes (Uri url, 
                String mimeTypeFilter)
```

Query for the possible MIME types for the representations the given content URL can be returned when opened as as stream with[openTypedAssetFileDescriptor(Uri, String, Bundle)](https://developer.android.com/reference/android/content/ContentResolver#openTypedAssetFileDescriptor(android.net.Uri,%20java.lang.String,%20android.os.Bundle)). Note that the types here are not necessarily a superset of the type returned by[getType(Uri)](https://developer.android.com/reference/android/content/ContentResolver#getType(android.net.Uri))-- many content providers cannot return a raw stream for the structured data that they contain.

<br />

|                                                                                        Parameters                                                                                         ||
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `url`            | `Uri`: A Uri identifying content (either a list or specific type), using the content:// scheme. This value cannot be`null`. <br />                                      |
| `mimeTypeFilter` | `String`: The desired MIME type. This may be a pattern, such as \*/\*, to query for all available MIME types that match the pattern. This value cannot be`null`. <br /> |

|                                                                                                           Returns                                                                                                           ||
|----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String[]](https://developer.android.com/reference/java/lang/String) | Returns an array of MIME type strings for all available data streams that match the given mimeTypeFilter. If there are none, null is returned. <br /> |

### getSyncAdapterTypes

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static SyncAdapterType[] getSyncAdapterTypes ()
```

Get information about the SyncAdapters that are known to the system.

<br />

|                                                                              Returns                                                                               ||
|----------------------------------------------------------------------------------------------|----------------------------------------------------------------------|
| [SyncAdapterType[]](https://developer.android.com/reference/android/content/SyncAdapterType) | an array of SyncAdapters that have registered with the system <br /> |

### getSyncAutomatically

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static boolean getSyncAutomatically (Account account, 
                String authority)
```

Check if the provider should be synced when a network tickle is received

This method requires the caller to hold the permission[Manifest.permission.READ_SYNC_SETTINGS](https://developer.android.com/reference/android/Manifest.permission#READ_SYNC_SETTINGS).

<br />

|                                Parameters                                ||
|-------------|-------------------------------------------------------------|
| `account`   | `Account`: the account whose setting we are querying <br /> |
| `authority` | `String`: the provider whose setting we are querying <br /> |

|                                          Returns                                          ||
|-----------|--------------------------------------------------------------------------------|
| `boolean` | true if the provider should be synced when a network tickle is received <br /> |

### getType

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final String getType (Uri url)
```

Return the MIME type of the given content URL.

<br />

|                                                                Parameters                                                                 ||
|-------|------------------------------------------------------------------------------------------------------------------------------------|
| `url` | `Uri`: A Uri identifying content (either a list or specific type), using the content:// scheme. This value cannot be`null`. <br /> |

|                                                                           Returns                                                                            ||
|--------------------------------------------------------------------|------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | A MIME type for the content, or null if the URL is invalid or the type is unknown <br /> |

### getTypeInfo

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final ContentResolver.MimeTypeInfo getTypeInfo (String mimeType)
```

Return a detailed description of the given MIME type, including an icon and label that describe the type.

<br />

|                                     Parameters                                      ||
|------------|-------------------------------------------------------------------------|
| `mimeType` | `String`: Valid, concrete MIME type. This value cannot be`null`. <br /> |

|                                                                         Returns                                                                          ||
|----------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [ContentResolver.MimeTypeInfo](https://developer.android.com/reference/android/content/ContentResolver.MimeTypeInfo) | This value cannot be`null`. <br /> |

### insert

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Uri insert (Uri url, 
                ContentValues values, 
                Bundle extras)
```

Inserts a row into a table at the given URL. If the content provider supports transactions the insertion will be atomic.

<br />

|                                                                                                                                                                                                         Parameters                                                                                                                                                                                                         ||
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `url`    | `Uri`: The URL of the table to insert into. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                   |
| `values` | `ContentValues`: The initial values for the newly inserted row. The key is the column name for the field. Passing an empty ContentValues will create an empty row. This value may be`null`. <br />                                                                                                                                                                                                               |
| `extras` | `Bundle`: A Bundle containing additional information necessary for the operation. Arguments may include SQL style arguments, such as[ContentResolver.QUERY_ARG_SQL_LIMIT](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SQL_LIMIT), but note that the documentation for each individual provider will indicate which arguments they support. This value may be`null`. <br /> |

|                                                                                           Returns                                                                                            ||
|----------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|
| [Uri](https://developer.android.com/reference/android/net/Uri) | the URL of the newly created row. May return`null`if the underlying content provider returns`null`, or if it crashes. <br /> |

|                                                                                     Throws                                                                                     ||
|--------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) | if the provider doesn't support one of the requested Bundle arguments. |

### insert

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Uri insert (Uri url, 
                ContentValues values)
```

Inserts a row into a table at the given URL. If the content provider supports transactions the insertion will be atomic.

<br />

|                                                                                                  Parameters                                                                                                  ||
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `url`    | `Uri`: The URL of the table to insert into. This value cannot be`null`. <br />                                                                                                                     |
| `values` | `ContentValues`: The initial values for the newly inserted row. The key is the column name for the field. Passing an empty ContentValues will create an empty row. This value may be`null`. <br /> |

|                                                                                           Returns                                                                                            ||
|----------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|
| [Uri](https://developer.android.com/reference/android/net/Uri) | the URL of the newly created row. May return`null`if the underlying content provider returns`null`, or if it crashes. <br /> |

### isSyncActive

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static boolean isSyncActive (Account account, 
                String authority)
```

Returns true if there is currently a sync operation for the given account or authority actively being processed.

This method requires the caller to hold the permission[Manifest.permission.READ_SYNC_STATS](https://developer.android.com/reference/android/Manifest.permission#READ_SYNC_STATS).

<br />

|                                 Parameters                                 ||
|-------------|---------------------------------------------------------------|
| `account`   | `Account`: the account whose setting we are querying <br />   |
| `authority` | `String`: the provider whose behavior is being queried <br /> |

|                                    Returns                                     ||
|-----------|---------------------------------------------------------------------|
| `boolean` | true if a sync is active for the given account or authority. <br /> |

### isSyncPending

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static boolean isSyncPending (Account account, 
                String authority)
```

Return true if the pending status is true of any matching authorities.

This method requires the caller to hold the permission[Manifest.permission.READ_SYNC_STATS](https://developer.android.com/reference/android/Manifest.permission#READ_SYNC_STATS).

<br />

|                                 Parameters                                 ||
|-------------|---------------------------------------------------------------|
| `account`   | `Account`: the account whose setting we are querying <br />   |
| `authority` | `String`: the provider whose behavior is being queried <br /> |

|                                          Returns                                          ||
|-----------|--------------------------------------------------------------------------------|
| `boolean` | true if there is a pending sync with the matching account and authority <br /> |

### loadThumbnail

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public Bitmap loadThumbnail (Uri uri, 
                Size size, 
                CancellationSignal signal)
```

Convenience method that efficiently loads a visual thumbnail for the given[Uri](https://developer.android.com/reference/android/net/Uri). Internally calls[ContentProvider.openTypedAssetFile](https://developer.android.com/reference/android/content/ContentProvider#openTypedAssetFile(android.net.Uri,%20java.lang.String,%20android.os.Bundle))on the remote provider, but also defensively resizes any returned content to match the requested target size.

<br />

|                                                                                                                                                     Parameters                                                                                                                                                      ||
|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`    | `Uri`: The item that should be visualized as a thumbnail. This value cannot be`null`. <br />                                                                                                                                                                                                              |
| `size`   | `Size`: The target area on the screen where this thumbnail will be shown. This is passed to the provider as[EXTRA_SIZE](https://developer.android.com/reference/android/content/ContentResolver#EXTRA_SIZE)to help it avoid downloading or generating heavy resources. This value cannot be`null`. <br /> |
| `signal` | `CancellationSignal`: A signal to cancel the operation in progress. This value may be`null`. <br />                                                                                                                                                                                                       |

|                                                                                                         Returns                                                                                                          ||
|---------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap) | Valid[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap)which is a visual thumbnail. This value cannot be`null`. <br /> |

|                                                                                                                                        Throws                                                                                                                                        ||
|----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [IOException](https://developer.android.com/reference/java/io/IOException) | If any trouble was encountered while generating or loading the thumbnail, or if[CancellationSignal.cancel()](https://developer.android.com/reference/android/os/CancellationSignal#cancel())was invoked. |

### notifyChange

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void notifyChange (Collection<Uri> uris, 
                ContentObserver observer, 
                int flags)
```

Notify registered observers that several rows have been updated.

To observe events sent through this call, use[registerContentObserver(android.net.Uri, boolean, android.database.ContentObserver)](https://developer.android.com/reference/android/content/ContentResolver#registerContentObserver(android.net.Uri,%20boolean,%20android.database.ContentObserver)).

If[NOTIFY_SYNC_TO_NETWORK](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_SYNC_TO_NETWORK)is set, this will attempt to schedule a local sync using the sync adapter that's registered for the authority of the provided uri. No account will be passed to the sync adapter, so all matching accounts will be synchronized.

Starting in[Build.VERSION_CODES.O](https://developer.android.com/reference/android/os/Build.VERSION_CODES#O), all content notifications must be backed by a valid[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider).

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ||
|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uris`     | `Collection`: The uris of the content that was changed. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `observer` | `ContentObserver`: The observer that originated the change, may be`null. The observer that originated the change will only receive the notification if it has requested to receive self-change notifications by implementing `[ContentObserver.deliverSelfNotifications()](https://developer.android.com/reference/android/database/ContentObserver#deliverSelfNotifications())` to return true.` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `flags`    | `int`: Flags such as[NOTIFY_SYNC_TO_NETWORK](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_SYNC_TO_NETWORK)or[NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS). Value is either`0`or a combination of[NOTIFY_SYNC_TO_NETWORK](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_SYNC_TO_NETWORK),[NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS),[NOTIFY_INSERT](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_INSERT),[NOTIFY_UPDATE](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_UPDATE), and[NOTIFY_DELETE](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_DELETE) <br /> |

### notifyChange

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void notifyChange (Uri uri, 
                ContentObserver observer, 
                boolean syncToNetwork)
```

<br />

**This method was deprecated in API level 30.**   
callers should consider migrating to[notifyChange(android.net.Uri, android.database.ContentObserver, int)](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20int)), as it offers support for many more options than just[NOTIFY_SYNC_TO_NETWORK](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_SYNC_TO_NETWORK).

Notify registered observers that a row was updated.

To observe events sent through this call, use[registerContentObserver(android.net.Uri, boolean, android.database.ContentObserver)](https://developer.android.com/reference/android/content/ContentResolver#registerContentObserver(android.net.Uri,%20boolean,%20android.database.ContentObserver)).

If syncToNetwork is true, this will attempt to schedule a local sync using the sync adapter that's registered for the authority of the provided uri. No account will be passed to the sync adapter, so all matching accounts will be synchronized.

Starting in[Build.VERSION_CODES.O](https://developer.android.com/reference/android/os/Build.VERSION_CODES#O), all content notifications must be backed by a valid[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider).

<br />

|                                                                                                                                                                                                        Parameters                                                                                                                                                                                                         ||
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`           | `Uri`: The uri of the content that was changed. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                       |
| `observer`      | `ContentObserver`: The observer that originated the change, may be`null. The observer that originated the change will only receive the notification if it has requested to receive self-change notifications by implementing `[ContentObserver.deliverSelfNotifications()](https://developer.android.com/reference/android/database/ContentObserver#deliverSelfNotifications())` to return true.` <br /> |
| `syncToNetwork` | `boolean`: If true, same as[NOTIFY_SYNC_TO_NETWORK](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_SYNC_TO_NETWORK). <br />                                                                                                                                                                                                                                              |

**See also:**

- [requestSync(android.accounts.Account, String, android.os.Bundle)](https://developer.android.com/reference/android/content/ContentResolver#requestSync(android.accounts.Account,%20java.lang.String,%20android.os.Bundle))  

### notifyChange

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void notifyChange (Uri uri, 
                ContentObserver observer, 
                int flags)
```

Notify registered observers that a row was updated.

To observe events sent through this call, use[registerContentObserver(android.net.Uri, boolean, android.database.ContentObserver)](https://developer.android.com/reference/android/content/ContentResolver#registerContentObserver(android.net.Uri,%20boolean,%20android.database.ContentObserver)).

If[NOTIFY_SYNC_TO_NETWORK](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_SYNC_TO_NETWORK)is set, this will attempt to schedule a local sync using the sync adapter that's registered for the authority of the provided uri. No account will be passed to the sync adapter, so all matching accounts will be synchronized.

Starting in[Build.VERSION_CODES.O](https://developer.android.com/reference/android/os/Build.VERSION_CODES#O), all content notifications must be backed by a valid[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider).

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                  Parameters                                                                                                                                                                                                                                                                                                                                                                                                  ||
|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`      | `Uri`: The uri of the content that was changed. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `observer` | `ContentObserver`: The observer that originated the change, may be`null. The observer that originated the change will only receive the notification if it has requested to receive self-change notifications by implementing `[ContentObserver.deliverSelfNotifications()](https://developer.android.com/reference/android/database/ContentObserver#deliverSelfNotifications())` to return true.` <br />                                                                                                                                                                                                                                                                                                                                                                                         |
| `flags`    | `int`: Additional flags:[NOTIFY_SYNC_TO_NETWORK](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_SYNC_TO_NETWORK). Value is either`0`or a combination of[NOTIFY_SYNC_TO_NETWORK](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_SYNC_TO_NETWORK),[NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS),[NOTIFY_INSERT](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_INSERT),[NOTIFY_UPDATE](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_UPDATE), and[NOTIFY_DELETE](https://developer.android.com/reference/android/content/ContentResolver#NOTIFY_DELETE) <br /> |

**See also:**

- [requestSync(android.accounts.Account, String, android.os.Bundle)](https://developer.android.com/reference/android/content/ContentResolver#requestSync(android.accounts.Account,%20java.lang.String,%20android.os.Bundle))  

### notifyChange

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void notifyChange (Uri uri, 
                ContentObserver observer)
```

Notify registered observers that a row was updated and attempt to sync changes to the network.

To observe events sent through this call, use[registerContentObserver(android.net.Uri, boolean, android.database.ContentObserver)](https://developer.android.com/reference/android/content/ContentResolver#registerContentObserver(android.net.Uri,%20boolean,%20android.database.ContentObserver)).

Starting in[Build.VERSION_CODES.O](https://developer.android.com/reference/android/os/Build.VERSION_CODES#O), all content notifications must be backed by a valid[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider).

<br />

|                                                                                                                                                                                                      Parameters                                                                                                                                                                                                      ||
|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`      | `Uri`: The uri of the content that was changed. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                       |
| `observer` | `ContentObserver`: The observer that originated the change, may be`null. The observer that originated the change will only receive the notification if it has requested to receive self-change notifications by implementing `[ContentObserver.deliverSelfNotifications()](https://developer.android.com/reference/android/database/ContentObserver#deliverSelfNotifications())` to return true.` <br /> |

### openAssetFile

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final AssetFileDescriptor openAssetFile (Uri uri, 
                String mode, 
                CancellationSignal signal)
```

<br />

<br />

|                           Parameters                            ||
|----------|-------------------------------------------------------|
| `uri`    | `Uri`: This value cannot be`null`. <br />             |
| `mode`   | `String`: This value cannot be`null`. <br />          |
| `signal` | `CancellationSignal`: This value may be`null`. <br /> |

|                                                                 Returns                                                                 ||
|--------------------------------------------------------------------------------------------------------|---------------------------------|
| [AssetFileDescriptor](https://developer.android.com/reference/android/content/res/AssetFileDescriptor) | This value may be`null`. <br /> |

|                                              Throws                                               ||
|------------------------------------------------------------------------------------------------|---|
| [FileNotFoundException](https://developer.android.com/reference/java/io/FileNotFoundException) |   |

### openAssetFileDescriptor

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final AssetFileDescriptor openAssetFileDescriptor (Uri uri, 
                String mode, 
                CancellationSignal cancellationSignal)
```

Open a raw file descriptor to access data under a URI. This interacts with the underlying[ContentProvider.openAssetFile](https://developer.android.com/reference/android/content/ContentProvider#openAssetFile(android.net.Uri,%20java.lang.String))method of the provider associated with the given URI, to retrieve any file stored there.

##### Accepts the following URI schemes:

- content ([SCHEME_CONTENT](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_CONTENT))
- android.resource ([SCHEME_ANDROID_RESOURCE](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_ANDROID_RESOURCE))
- file ([SCHEME_FILE](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_FILE))

##### The android.resource ([SCHEME_ANDROID_RESOURCE](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_ANDROID_RESOURCE)) Scheme

A Uri object can be used to reference a resource in an APK file. The Uri should be one of the following formats:

- `android.resource://package_name/id_number`  
  `package_name`is your package name as listed in your AndroidManifest.xml. For example`com.example.myapp`  
  `id_number`is the int form of the ID.  
  The easiest way to construct this form is  

  ```
  Uri uri = Uri.parse("android.resource://com.example.myapp/" + R.raw.my_resource");
  ```
- `android.resource://package_name/type/name`  
  `package_name`is your package name as listed in your AndroidManifest.xml. For example`com.example.myapp`  
  `type`is the string form of the resource type. For example,`raw`or`drawable`.`name`is the string form of the resource name. That is, whatever the file name was in your res directory, without the type extension. The easiest way to construct this form is  

  ```
  Uri uri = Uri.parse("android.resource://com.example.myapp/raw/my_resource");
  ```

Note that if this function is called for read-only input (mode is "r") on a content: URI, it will instead call[openTypedAssetFileDescriptor(Uri, String, Bundle)](https://developer.android.com/reference/android/content/ContentResolver#openTypedAssetFileDescriptor(android.net.Uri,%20java.lang.String,%20android.os.Bundle))for you with a MIME type of "\*/\*". This allows such callers to benefit from any built-in data conversion that a provider implements.

<br />

|                                                                                                                                                                                     Parameters                                                                                                                                                                                     ||
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`                | `Uri`: The desired URI to open. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                           |
| `mode`               | `String`: The string representation of the file mode. Can be "r", "w", "wt", "wa", "rw" or "rwt". Please note "w" is write only and "wt" is write and truncate. See[ParcelFileDescriptor.parseMode](https://developer.android.com/reference/android/os/ParcelFileDescriptor#parseMode(java.lang.String))for more details. This value cannot be`null`. <br /> |
| `cancellationSignal` | `CancellationSignal`: A signal to cancel the operation in progress, or null if none. If the operation is canceled, then[OperationCanceledException](https://developer.android.com/reference/android/os/OperationCanceledException)will be thrown. <br />                                                                                                     |

|                                                                                                                                        Returns                                                                                                                                         ||
|--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AssetFileDescriptor](https://developer.android.com/reference/android/content/res/AssetFileDescriptor) | Returns a new ParcelFileDescriptor pointing to the file or`null`if the provider recently crashed. You own this descriptor and are responsible for closing it when done. <br /> |

|                                                                                        Throws                                                                                        ||
|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
| [FileNotFoundException](https://developer.android.com/reference/java/io/FileNotFoundException) | Throws FileNotFoundException of no file exists under the URI or the mode is invalid. |

### openAssetFileDescriptor

Added in[API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final AssetFileDescriptor openAssetFileDescriptor (Uri uri, 
                String mode)
```

Open a raw file descriptor to access data under a URI. This interacts with the underlying[ContentProvider.openAssetFile](https://developer.android.com/reference/android/content/ContentProvider#openAssetFile(android.net.Uri,%20java.lang.String))method of the provider associated with the given URI, to retrieve any file stored there.

##### Accepts the following URI schemes:

- content ([SCHEME_CONTENT](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_CONTENT))
- android.resource ([SCHEME_ANDROID_RESOURCE](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_ANDROID_RESOURCE))
- file ([SCHEME_FILE](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_FILE))

##### The android.resource ([SCHEME_ANDROID_RESOURCE](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_ANDROID_RESOURCE)) Scheme

A Uri object can be used to reference a resource in an APK file. The Uri should be one of the following formats:

- `android.resource://package_name/id_number`  
  `package_name`is your package name as listed in your AndroidManifest.xml. For example`com.example.myapp`  
  `id_number`is the int form of the ID.  
  The easiest way to construct this form is  

  ```
  Uri uri = Uri.parse("android.resource://com.example.myapp/" + R.raw.my_resource");
  ```
- `android.resource://package_name/type/name`  
  `package_name`is your package name as listed in your AndroidManifest.xml. For example`com.example.myapp`  
  `type`is the string form of the resource type. For example,`raw`or`drawable`.`name`is the string form of the resource name. That is, whatever the file name was in your res directory, without the type extension. The easiest way to construct this form is  

  ```
  Uri uri = Uri.parse("android.resource://com.example.myapp/raw/my_resource");
  ```

Note that if this function is called for read-only input (mode is "r") on a content: URI, it will instead call[openTypedAssetFileDescriptor(Uri, String, Bundle)](https://developer.android.com/reference/android/content/ContentResolver#openTypedAssetFileDescriptor(android.net.Uri,%20java.lang.String,%20android.os.Bundle))for you with a MIME type of "\*/\*". This allows such callers to benefit from any built-in data conversion that a provider implements.

<br />

|                                                                                                                                     Parameters                                                                                                                                     ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`  | `Uri`: The desired URI to open. This value cannot be`null`. <br />                                                                                                                                                                                                         |
| `mode` | `String`: The string representation of the file mode. Can be "r", "w", "wt", "wa", "rw" or "rwt". Please note the exact implementation of these may differ for each Provider implementation - for example, "w" may or may not truncate. This value cannot be`null`. <br /> |

|                                                                                                                                        Returns                                                                                                                                         ||
|--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AssetFileDescriptor](https://developer.android.com/reference/android/content/res/AssetFileDescriptor) | Returns a new ParcelFileDescriptor pointing to the file or`null`if the provider recently crashed. You own this descriptor and are responsible for closing it when done. <br /> |

|                                                                                        Throws                                                                                        ||
|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
| [FileNotFoundException](https://developer.android.com/reference/java/io/FileNotFoundException) | Throws FileNotFoundException of no file exists under the URI or the mode is invalid. |

### openFile

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final ParcelFileDescriptor openFile (Uri uri, 
                String mode, 
                CancellationSignal signal)
```

<br />

<br />

|                           Parameters                            ||
|----------|-------------------------------------------------------|
| `uri`    | `Uri`: This value cannot be`null`. <br />             |
| `mode`   | `String`: This value cannot be`null`. <br />          |
| `signal` | `CancellationSignal`: This value may be`null`. <br /> |

|                                                             Returns                                                              ||
|-------------------------------------------------------------------------------------------------|---------------------------------|
| [ParcelFileDescriptor](https://developer.android.com/reference/android/os/ParcelFileDescriptor) | This value may be`null`. <br /> |

|                                              Throws                                               ||
|------------------------------------------------------------------------------------------------|---|
| [FileNotFoundException](https://developer.android.com/reference/java/io/FileNotFoundException) |   |

### openFileDescriptor

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final ParcelFileDescriptor openFileDescriptor (Uri uri, 
                String mode, 
                CancellationSignal cancellationSignal)
```

Open a raw file descriptor to access data under a URI. This is like[openAssetFileDescriptor(android.net.Uri, java.lang.String)](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String)), but uses the underlying[ContentProvider.openFile](https://developer.android.com/reference/android/content/ContentProvider#openFile(android.net.Uri,%20java.lang.String))ContentProvider.openFile()} method, so will*not* work with providers that return sub-sections of files. If at all possible, you should use[openAssetFileDescriptor(android.net.Uri, java.lang.String)](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String)). You will receive a FileNotFoundException exception if the provider returns a sub-section of a file.

##### Accepts the following URI schemes:

- content ([SCHEME_CONTENT](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_CONTENT))
- file ([SCHEME_FILE](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_FILE))

See[openAssetFileDescriptor(android.net.Uri, java.lang.String)](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String))for more information on these schemes.

If opening with the exclusive "r" or "w" modes, the returned ParcelFileDescriptor could be a pipe or socket pair to enable streaming of data. Opening with the "rw" mode implies a file on disk that supports seeking. If possible, always use an exclusive mode to give the underlying[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)the most flexibility.

If you are writing a file, and need to communicate an error to the provider, use[ParcelFileDescriptor.closeWithError(String)](https://developer.android.com/reference/android/os/ParcelFileDescriptor#closeWithError(java.lang.String)).

<br />

|                                                                                                                                            Parameters                                                                                                                                            ||
|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`                | `Uri`: The desired URI to open. This value cannot be`null`. <br />                                                                                                                                                                                                         |
| `mode`               | `String`: The string representation of the file mode. Can be "r", "w", "wt", "wa", "rw" or "rwt". Please note the exact implementation of these may differ for each Provider implementation - for example, "w" may or may not truncate. This value cannot be`null`. <br /> |
| `cancellationSignal` | `CancellationSignal`: A signal to cancel the operation in progress, or null if none. If the operation is canceled, then[OperationCanceledException](https://developer.android.com/reference/android/os/OperationCanceledException)will be thrown. <br />                   |

|                                                                                                                                     Returns                                                                                                                                     ||
|-------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ParcelFileDescriptor](https://developer.android.com/reference/android/os/ParcelFileDescriptor) | Returns a new ParcelFileDescriptor pointing to the file or`null`if the provider recently crashed. You own this descriptor and are responsible for closing it when done. <br /> |

|                                                                                        Throws                                                                                        ||
|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
| [FileNotFoundException](https://developer.android.com/reference/java/io/FileNotFoundException) | Throws FileNotFoundException if no file exists under the URI or the mode is invalid. |

**See also:**

- [openAssetFileDescriptor(Uri, String)](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String))  

### openFileDescriptor

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final ParcelFileDescriptor openFileDescriptor (Uri uri, 
                String mode)
```

Open a raw file descriptor to access data under a URI. This is like[openAssetFileDescriptor(android.net.Uri, java.lang.String)](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String)), but uses the underlying[ContentProvider.openFile](https://developer.android.com/reference/android/content/ContentProvider#openFile(android.net.Uri,%20java.lang.String))ContentProvider.openFile()} method, so will*not* work with providers that return sub-sections of files. If at all possible, you should use[openAssetFileDescriptor(android.net.Uri, java.lang.String)](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String)). You will receive a FileNotFoundException exception if the provider returns a sub-section of a file.

##### Accepts the following URI schemes:

- content ([SCHEME_CONTENT](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_CONTENT))
- file ([SCHEME_FILE](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_FILE))

See[openAssetFileDescriptor(android.net.Uri, java.lang.String)](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String))for more information on these schemes.

If opening with the exclusive "r" or "w" modes, the returned ParcelFileDescriptor could be a pipe or socket pair to enable streaming of data. Opening with the "rw" mode implies a file on disk that supports seeking. If possible, always use an exclusive mode to give the underlying[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)the most flexibility.

If you are writing a file, and need to communicate an error to the provider, use[ParcelFileDescriptor.closeWithError(String)](https://developer.android.com/reference/android/os/ParcelFileDescriptor#closeWithError(java.lang.String)).

<br />

|                                                                                                                                     Parameters                                                                                                                                     ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`  | `Uri`: The desired URI to open. This value cannot be`null`. <br />                                                                                                                                                                                                         |
| `mode` | `String`: The string representation of the file mode. Can be "r", "w", "wt", "wa", "rw" or "rwt". Please note the exact implementation of these may differ for each Provider implementation - for example, "w" may or may not truncate. This value cannot be`null`. <br /> |

|                                                                                                                                     Returns                                                                                                                                     ||
|-------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ParcelFileDescriptor](https://developer.android.com/reference/android/os/ParcelFileDescriptor) | Returns a new ParcelFileDescriptor pointing to the file or`null`if the provider recently crashed. You own this descriptor and are responsible for closing it when done. <br /> |

|                                                                                        Throws                                                                                        ||
|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
| [FileNotFoundException](https://developer.android.com/reference/java/io/FileNotFoundException) | Throws FileNotFoundException if no file exists under the URI or the mode is invalid. |

**See also:**

- [openAssetFileDescriptor(Uri, String)](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String))  

### openInputStream

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final InputStream openInputStream (Uri uri)
```

Open a stream on to the content associated with a content URI. If there is no data associated with the URI, FileNotFoundException is thrown.

##### Accepts the following URI schemes:

- content ([SCHEME_CONTENT](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_CONTENT))
- android.resource ([SCHEME_ANDROID_RESOURCE](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_ANDROID_RESOURCE))
- file ([SCHEME_FILE](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_FILE))

See[openAssetFileDescriptor(android.net.Uri, java.lang.String)](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String))for more information on these schemes.

<br />

|                            Parameters                             ||
|-------|------------------------------------------------------------|
| `uri` | `Uri`: The desired URI. This value cannot be`null`. <br /> |

|                                                                 Returns                                                                  ||
|----------------------------------------------------------------------------|--------------------------------------------------------------|
| [InputStream](https://developer.android.com/reference/java/io/InputStream) | InputStream or`null`if the provider recently crashed. <br /> |

|                                                                  Throws                                                                  ||
|------------------------------------------------------------------------------------------------|------------------------------------------|
| [FileNotFoundException](https://developer.android.com/reference/java/io/FileNotFoundException) | if the provided URI could not be opened. |

**See also:**

- [openAssetFileDescriptor(Uri, String)](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String))  

### openOutputStream

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final OutputStream openOutputStream (Uri uri)
```

Synonym for[openOutputStream(uri, "w")](https://developer.android.com/reference/android/content/ContentResolver#openOutputStream(android.net.Uri,%20java.lang.String)). Please note the implementation of "w" is up to each Provider implementation and it may or may not truncate.

<br />

|                            Parameters                             ||
|-------|------------------------------------------------------------|
| `uri` | `Uri`: The desired URI. This value cannot be`null`. <br /> |

|                                                                    Returns                                                                     ||
|------------------------------------------------------------------------------|------------------------------------------------------------------|
| [OutputStream](https://developer.android.com/reference/java/io/OutputStream) | an OutputStream or`null`if the provider recently crashed. <br /> |

|                                                                  Throws                                                                  ||
|------------------------------------------------------------------------------------------------|------------------------------------------|
| [FileNotFoundException](https://developer.android.com/reference/java/io/FileNotFoundException) | if the provided URI could not be opened. |

### openOutputStream

Added in[API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final OutputStream openOutputStream (Uri uri, 
                String mode)
```

Open a stream on to the content associated with a content URI. If there is no data associated with the URI, FileNotFoundException is thrown.

##### Accepts the following URI schemes:

- content ([SCHEME_CONTENT](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_CONTENT))
- file ([SCHEME_FILE](https://developer.android.com/reference/android/content/ContentResolver#SCHEME_FILE))

See[openAssetFileDescriptor(android.net.Uri, java.lang.String)](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String))for more information on these schemes.

<br />

|                                                                                                                                     Parameters                                                                                                                                     ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`  | `Uri`: The desired URI. This value cannot be`null`. <br />                                                                                                                                                                                                                 |
| `mode` | `String`: The string representation of the file mode. Can be "r", "w", "wt", "wa", "rw" or "rwt". Please note the exact implementation of these may differ for each Provider implementation - for example, "w" may or may not truncate. This value cannot be`null`. <br /> |

|                                                                    Returns                                                                     ||
|------------------------------------------------------------------------------|------------------------------------------------------------------|
| [OutputStream](https://developer.android.com/reference/java/io/OutputStream) | an OutputStream or`null`if the provider recently crashed. <br /> |

|                                                                  Throws                                                                  ||
|------------------------------------------------------------------------------------------------|------------------------------------------|
| [FileNotFoundException](https://developer.android.com/reference/java/io/FileNotFoundException) | if the provided URI could not be opened. |

**See also:**

- [openAssetFileDescriptor(Uri, String)](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String))  

### openTypedAssetFile

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final AssetFileDescriptor openTypedAssetFile (Uri uri, 
                String mimeTypeFilter, 
                Bundle opts, 
                CancellationSignal signal)
```

<br />

<br />

|                               Parameters                                ||
|------------------|-------------------------------------------------------|
| `uri`            | `Uri`: This value cannot be`null`. <br />             |
| `mimeTypeFilter` | `String`: This value cannot be`null`. <br />          |
| `opts`           | `Bundle`: This value may be`null`. <br />             |
| `signal`         | `CancellationSignal`: This value may be`null`. <br /> |

|                                                                 Returns                                                                 ||
|--------------------------------------------------------------------------------------------------------|---------------------------------|
| [AssetFileDescriptor](https://developer.android.com/reference/android/content/res/AssetFileDescriptor) | This value may be`null`. <br /> |

|                                              Throws                                               ||
|------------------------------------------------------------------------------------------------|---|
| [FileNotFoundException](https://developer.android.com/reference/java/io/FileNotFoundException) |   |

### openTypedAssetFileDescriptor

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final AssetFileDescriptor openTypedAssetFileDescriptor (Uri uri, 
                String mimeType, 
                Bundle opts, 
                CancellationSignal cancellationSignal)
```

Open a raw file descriptor to access (potentially type transformed) data from a "content:" URI. This interacts with the underlying[ContentProvider.openTypedAssetFile](https://developer.android.com/reference/android/content/ContentProvider#openTypedAssetFile(android.net.Uri,%20java.lang.String,%20android.os.Bundle))method of the provider associated with the given URI, to retrieve any appropriate data stream for the data stored there.

Unlike[openAssetFileDescriptor(Uri, String)](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String)), this function only works with "content:" URIs, because content providers are the only facility with an associated MIME type to ensure that the returned data stream is of the desired type.

All text/\* streams are encoded in UTF-8.

<br />

|                                                                                                                                     Parameters                                                                                                                                     ||
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`                | `Uri`: The desired URI to open. This value cannot be`null`. <br />                                                                                                                                                                                           |
| `mimeType`           | `String`: The desired MIME type of the returned data. This can be a pattern such as \*/\*, which will allow the content provider to select a type, though there is no way for you to determine what type it is returning. This value cannot be`null`. <br /> |
| `opts`               | `Bundle`: Additional provider-dependent options. This value may be`null`. <br />                                                                                                                                                                             |
| `cancellationSignal` | `CancellationSignal`: A signal to cancel the operation in progress, or null if none. If the operation is canceled, then[OperationCanceledException](https://developer.android.com/reference/android/os/OperationCanceledException)will be thrown. <br />     |

|                                                                                                                                                                                                                                                   Returns                                                                                                                                                                                                                                                    ||
|--------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AssetFileDescriptor](https://developer.android.com/reference/android/content/res/AssetFileDescriptor) | Returns a new ParcelFileDescriptor from which you can read the data stream from the provider or`null`if the provider recently crashed. Note that this may be a pipe, meaning you can't seek in it. The only seek you should do is if the AssetFileDescriptor contains an offset, to move to that offset before reading. You own this descriptor and are responsible for closing it when done. <br /> |

|                                                                                      Throws                                                                                       ||
|------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
| [FileNotFoundException](https://developer.android.com/reference/java/io/FileNotFoundException) | Throws FileNotFoundException of no data of the desired type exists under the URI. |

### openTypedAssetFileDescriptor

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final AssetFileDescriptor openTypedAssetFileDescriptor (Uri uri, 
                String mimeType, 
                Bundle opts)
```

Open a raw file descriptor to access (potentially type transformed) data from a "content:" URI. This interacts with the underlying[ContentProvider.openTypedAssetFile](https://developer.android.com/reference/android/content/ContentProvider#openTypedAssetFile(android.net.Uri,%20java.lang.String,%20android.os.Bundle))method of the provider associated with the given URI, to retrieve retrieve any appropriate data stream for the data stored there.

Unlike[openAssetFileDescriptor(Uri, String)](https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String)), this function only works with "content:" URIs, because content providers are the only facility with an associated MIME type to ensure that the returned data stream is of the desired type.

All text/\* streams are encoded in UTF-8.

<br />

|                                                                                                                                Parameters                                                                                                                                ||
|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`      | `Uri`: The desired URI to open. This value cannot be`null`. <br />                                                                                                                                                                                           |
| `mimeType` | `String`: The desired MIME type of the returned data. This can be a pattern such as \*/\*, which will allow the content provider to select a type, though there is no way for you to determine what type it is returning. This value cannot be`null`. <br /> |
| `opts`     | `Bundle`: Additional provider-dependent options. This value may be`null`. <br />                                                                                                                                                                             |

|                                                                                                                                                                                                                                                   Returns                                                                                                                                                                                                                                                    ||
|--------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AssetFileDescriptor](https://developer.android.com/reference/android/content/res/AssetFileDescriptor) | Returns a new ParcelFileDescriptor from which you can read the data stream from the provider or`null`if the provider recently crashed. Note that this may be a pipe, meaning you can't seek in it. The only seek you should do is if the AssetFileDescriptor contains an offset, to move to that offset before reading. You own this descriptor and are responsible for closing it when done. <br /> |

|                                                                                      Throws                                                                                       ||
|------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
| [FileNotFoundException](https://developer.android.com/reference/java/io/FileNotFoundException) | Throws FileNotFoundException of no data of the desired type exists under the URI. |

### query

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Cursor query (Uri uri, 
                String[] projection, 
                Bundle queryArgs, 
                CancellationSignal cancellationSignal)
```

Query the given URI, returning a[Cursor](https://developer.android.com/reference/android/database/Cursor)over the result set with support for cancellation.

For best performance, the caller should follow these guidelines:
- Provide an explicit projection, to prevent reading data from storage that aren't going to be used. Provider must identify which QUERY_ARG_SORT\* arguments were honored during the preparation of the result set by including the respective argument keys in the[Cursor](https://developer.android.com/reference/android/database/Cursor)extras[Bundle](https://developer.android.com/reference/android/os/Bundle). See[EXTRA_HONORED_ARGS](https://developer.android.com/reference/android/content/ContentResolver#EXTRA_HONORED_ARGS)for details.

  <br />

  <br />

  |                                                                                                                                                                                                               Parameters                                                                                                                                                                                                               ||
  |----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | `uri`                | `Uri`: The URI, using the content:// scheme, for the content to retrieve. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                     |
  | `projection`         | `String`: A list of which columns to return. Passing null will return all columns, which is inefficient. <br />                                                                                                                                                                                                                                                                                                  |
  | `queryArgs`          | `Bundle`: A Bundle containing additional information necessary for the operation. Arguments may include SQL style arguments, such as[ContentResolver.QUERY_ARG_SQL_LIMIT](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SQL_LIMIT), but note that the documentation for each individual provider will indicate which arguments they support. This value may be`null`. <br /> |
  | `cancellationSignal` | `CancellationSignal`: A signal to cancel the operation in progress, or null if none. If the operation is canceled, then[OperationCanceledException](https://developer.android.com/reference/android/os/OperationCanceledException)will be thrown when the query is executed. <br />                                                                                                                              |

  |                                                                                                              Returns                                                                                                               ||
  |---------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
  | [Cursor](https://developer.android.com/reference/android/database/Cursor) | A Cursor object, which is positioned before the first entry. May return`null`if the underlying content provider returns`null`, or if it crashes. <br /> |

  **See also:**
  - [QUERY_ARG_SORT_COLUMNS](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLUMNS)
  - [QUERY_ARG_SORT_DIRECTION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_DIRECTION)
  - [QUERY_ARG_SORT_COLLATION](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SORT_COLLATION)
- [Cursor](https://developer.android.com/reference/android/database/Cursor)  

### query

Added in[API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Cursor query (Uri uri, 
                String[] projection, 
                String selection, 
                String[] selectionArgs, 
                String sortOrder, 
                CancellationSignal cancellationSignal)
```

Query the given URI, returning a[Cursor](https://developer.android.com/reference/android/database/Cursor)over the result set with optional support for cancellation.

For best performance, the caller should follow these guidelines:

- Provide an explicit projection, to prevent reading data from storage that aren't going to be used.
- Use question mark parameter markers such as 'phone=?' instead of explicit values in the`selection`parameter, so that queries that differ only by those values will be recognized as the same for caching purposes.

<br />

<br />

<br />

|                                                                                                                                                Parameters                                                                                                                                                 ||
|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`                | `Uri`: The URI, using the content:// scheme, for the content to retrieve. This value cannot be`null`. <br />                                                                                                                                                                        |
| `projection`         | `String`: A list of which columns to return. Passing null will return all columns, which is inefficient. <br />                                                                                                                                                                     |
| `selection`          | `String`: A filter declaring which rows to return, formatted as an SQL WHERE clause (excluding the WHERE itself). Passing null will return all rows for the given URI. <br />                                                                                                       |
| `selectionArgs`      | `String`: You may include ?s in selection, which will be replaced by the values from selectionArgs, in the order that they appear in the selection. The values will be bound as Strings. This value may be`null`. <br />                                                            |
| `sortOrder`          | `String`: How to order the rows, formatted as an SQL ORDER BY clause (excluding the ORDER BY itself). Passing null will use the default sort order, which may be unordered. <br />                                                                                                  |
| `cancellationSignal` | `CancellationSignal`: A signal to cancel the operation in progress, or null if none. If the operation is canceled, then[OperationCanceledException](https://developer.android.com/reference/android/os/OperationCanceledException)will be thrown when the query is executed. <br /> |

|                                                                                                              Returns                                                                                                               ||
|---------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Cursor](https://developer.android.com/reference/android/database/Cursor) | A Cursor object, which is positioned before the first entry. May return`null`if the underlying content provider returns`null`, or if it crashes. <br /> |

**See also:**

- [Cursor](https://developer.android.com/reference/android/database/Cursor)  

### query

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Cursor query (Uri uri, 
                String[] projection, 
                String selection, 
                String[] selectionArgs, 
                String sortOrder)
```

Query the given URI, returning a[Cursor](https://developer.android.com/reference/android/database/Cursor)over the result set.

For best performance, the caller should follow these guidelines:

- Provide an explicit projection, to prevent reading data from storage that aren't going to be used.
- Use question mark parameter markers such as 'phone=?' instead of explicit values in the`selection`parameter, so that queries that differ only by those values will be recognized as the same for caching purposes.

<br />

<br />

<br />

|                                                                                                                Parameters                                                                                                                 ||
|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`           | `Uri`: The URI, using the content:// scheme, for the content to retrieve. This value cannot be`null`. <br />                                                                                                             |
| `projection`    | `String`: A list of which columns to return. Passing null will return all columns, which is inefficient. <br />                                                                                                          |
| `selection`     | `String`: A filter declaring which rows to return, formatted as an SQL WHERE clause (excluding the WHERE itself). Passing null will return all rows for the given URI. <br />                                            |
| `selectionArgs` | `String`: You may include ?s in selection, which will be replaced by the values from selectionArgs, in the order that they appear in the selection. The values will be bound as Strings. This value may be`null`. <br /> |
| `sortOrder`     | `String`: How to order the rows, formatted as an SQL ORDER BY clause (excluding the ORDER BY itself). Passing null will use the default sort order, which may be unordered. <br />                                       |

|                                                                                                              Returns                                                                                                               ||
|---------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Cursor](https://developer.android.com/reference/android/database/Cursor) | A Cursor object, which is positioned before the first entry. May return`null`if the underlying content provider returns`null`, or if it crashes. <br /> |

**See also:**

- [Cursor](https://developer.android.com/reference/android/database/Cursor)  

### refresh

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final boolean refresh (Uri url, 
                Bundle extras, 
                CancellationSignal cancellationSignal)
```

This allows clients to request an explicit refresh of content identified by`uri`.

Client code should only invoke this method when there is a strong indication (such as a user initiated pull to refresh gesture) that the content is stale.

<br />

<br />

|                                                                                                                                                                                      Parameters                                                                                                                                                                                       ||
|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `url`                | `Uri`: The Uri identifying the data to refresh. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                              |
| `extras`             | `Bundle`: Additional options from the client. The definitions of these are specific to the content provider being called. This value may be`null`. <br />                                                                                                                                                                                                       |
| `cancellationSignal` | `CancellationSignal`: A signal to cancel the operation in progress, or`null`if none. For example, if you called refresh on a particular uri, you should call[CancellationSignal.throwIfCanceled()](https://developer.android.com/reference/android/os/CancellationSignal#throwIfCanceled())to check whether the client has canceled the refresh request. <br /> |

|                              Returns                              ||
|-----------|--------------------------------------------------------|
| `boolean` | true if the provider actually tried refreshing. <br /> |

### registerContentObserver

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final void registerContentObserver (Uri uri, 
                boolean notifyForDescendants, 
                ContentObserver observer)
```

Register an observer class that gets callbacks when data identified by a given content URI changes.

Starting in[Build.VERSION_CODES.O](https://developer.android.com/reference/android/os/Build.VERSION_CODES#O), all content notifications must be backed by a valid[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider).

<br />

|                                                                                                                                                          Parameters                                                                                                                                                           ||
|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`                  | `Uri`: The URI to watch for changes. This can be a specific row URI, or a base URI for a whole class of content. This value cannot be`null`. <br />                                                                                                                                                   |
| `notifyForDescendants` | `boolean`: When false, the observer will be notified whenever a change occurs to the exact URI specified by`uri`or to one of the URI's ancestors in the path hierarchy. When true, the observer will also be notified whenever a change occurs to the URI's descendants in the path hierarchy. <br /> |
| `observer`             | `ContentObserver`: The object that receives callbacks when changes occur. This value cannot be`null`. <br />                                                                                                                                                                                          |

**See also:**

- [unregisterContentObserver(ContentObserver)](https://developer.android.com/reference/android/content/ContentResolver#unregisterContentObserver(android.database.ContentObserver))  

### releasePersistableUriPermission

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void releasePersistableUriPermission (Uri uri, 
                int modeFlags)
```

Relinquish a persisted URI permission grant. The URI must have been previously made persistent with[takePersistableUriPermission(android.net.Uri, int)](https://developer.android.com/reference/android/content/ContentResolver#takePersistableUriPermission(android.net.Uri,%20int)). Any non-persistent grants to the calling package will remain intact.

<br />

|                                                                                                                                                                     Parameters                                                                                                                                                                      ||
|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`       | `Uri`: This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                              |
| `modeFlags` | `int`: Value is either`0`or a combination of[Intent.FLAG_GRANT_READ_URI_PERMISSION](https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION), and[Intent.FLAG_GRANT_WRITE_URI_PERMISSION](https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION) <br /> |

**See also:**

- [getPersistedUriPermissions()](https://developer.android.com/reference/android/content/ContentResolver#getPersistedUriPermissions())  

### removePeriodicSync

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static void removePeriodicSync (Account account, 
                String authority, 
                Bundle extras)
```

Remove a periodic sync. Has no affect if account, authority and extras don't match an existing periodic sync.

This method requires the caller to hold the permission[Manifest.permission.WRITE_SYNC_SETTINGS](https://developer.android.com/reference/android/Manifest.permission#WRITE_SYNC_SETTINGS).

<br />

|                                Parameters                                 ||
|-------------|--------------------------------------------------------------|
| `account`   | `Account`: the account of the periodic sync to remove <br /> |
| `authority` | `String`: the provider of the periodic sync to remove <br /> |
| `extras`    | `Bundle`: the extras of the periodic sync to remove <br />   |

### removeStatusChangeListener

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static void removeStatusChangeListener (Object handle)
```

Remove a previously registered status change listener.

<br />

|                                                                                                                        Parameters                                                                                                                        ||
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `handle` | `Object`: the handle that was returned by[addStatusChangeListener(int, SyncStatusObserver)](https://developer.android.com/reference/android/content/ContentResolver#addStatusChangeListener(int,%20android.content.SyncStatusObserver)) <br /> |

### requestSync

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static void requestSync (Account account, 
                String authority, 
                Bundle extras)
```

Start an asynchronous sync operation. If you want to monitor the progress of the sync you may register a SyncObserver. Only values of the following types may be used in the extras bundle:

- Integer
- Long
- Boolean
- Float
- Double
- String
- Account
- null

<br />

<br />

|                              Parameters                              ||
|-------------|---------------------------------------------------------|
| `account`   | `Account`: which account should be synced <br />        |
| `authority` | `String`: which authority should be synced <br />       |
| `extras`    | `Bundle`: any extras to pass to the SyncAdapter. <br /> |

### requestSync

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static void requestSync (SyncRequest request)
```

Register a sync with the SyncManager. These requests are built using the[SyncRequest.Builder](https://developer.android.com/reference/android/content/SyncRequest.Builder).

<br />

|           Parameters            ||
|-----------|----------------------|
| `request` | `SyncRequest` <br /> |

### setIsSyncable

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static void setIsSyncable (Account account, 
                String authority, 
                int syncable)
```

Set whether this account/provider is syncable.

This method requires the caller to hold the permission[Manifest.permission.WRITE_SYNC_SETTINGS](https://developer.android.com/reference/android/Manifest.permission#WRITE_SYNC_SETTINGS).

<br />

|                                        Parameters                                        ||
|-------------|-----------------------------------------------------------------------------|
| `account`   | `Account` <br />                                                            |
| `authority` | `String` <br />                                                             |
| `syncable`  | `int`: \>0 denotes syncable, 0 means not syncable, \<0 means unknown <br /> |

### setMasterSyncAutomatically

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static void setMasterSyncAutomatically (boolean sync)
```

Sets the global auto-sync setting that applies to all the providers and accounts. If this is false then the per-provider auto-sync setting is ignored.

This method requires the caller to hold the permission[Manifest.permission.WRITE_SYNC_SETTINGS](https://developer.android.com/reference/android/Manifest.permission#WRITE_SYNC_SETTINGS).

<br />

|                                              Parameters                                               ||
|--------|-----------------------------------------------------------------------------------------------|
| `sync` | `boolean`: the global auto-sync setting that applies to all the providers and accounts <br /> |

### setSyncAutomatically

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static void setSyncAutomatically (Account account, 
                String authority, 
                boolean sync)
```

Set whether or not the provider is synced when it receives a network tickle.

This method requires the caller to hold the permission[Manifest.permission.WRITE_SYNC_SETTINGS](https://developer.android.com/reference/android/Manifest.permission#WRITE_SYNC_SETTINGS).

<br />

|                                              Parameters                                               ||
|-------------|------------------------------------------------------------------------------------------|
| `account`   | `Account`: the account whose setting we are querying <br />                              |
| `authority` | `String`: the provider whose behavior is being controlled <br />                         |
| `sync`      | `boolean`: true if the provider should be synced when tickles are received for it <br /> |

### startSync

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void startSync (Uri uri, 
                Bundle extras)
```

<br />

**This method was deprecated in API level 15.**   
instead use[requestSync(android.accounts.Account, java.lang.String, android.os.Bundle)](https://developer.android.com/reference/android/content/ContentResolver#requestSync(android.accounts.Account,%20java.lang.String,%20android.os.Bundle))

Start an asynchronous sync operation. If you want to monitor the progress of the sync you may register a SyncObserver. Only values of the following types may be used in the extras bundle:

- Integer
- Long
- Boolean
- Float
- Double
- String
- Account
- null

<br />

<br />

|                                       Parameters                                       ||
|----------|------------------------------------------------------------------------------|
| `uri`    | `Uri`: the uri of the provider to sync or null to sync all providers. <br /> |
| `extras` | `Bundle`: any extras to pass to the SyncAdapter. <br />                      |

### takePersistableUriPermission

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void takePersistableUriPermission (Uri uri, 
                int modeFlags)
```

Take a persistable URI permission grant that has been offered. Once taken, the permission grant will be remembered across device reboots. Only URI permissions granted with[Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION](https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_PERSISTABLE_URI_PERMISSION)can be persisted. If the grant has already been persisted, taking it again will touch[UriPermission.getPersistedTime()](https://developer.android.com/reference/android/content/UriPermission#getPersistedTime()).

<br />

|                                                                                                                                                                     Parameters                                                                                                                                                                      ||
|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`       | `Uri`: This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                              |
| `modeFlags` | `int`: Value is either`0`or a combination of[Intent.FLAG_GRANT_READ_URI_PERMISSION](https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION), and[Intent.FLAG_GRANT_WRITE_URI_PERMISSION](https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION) <br /> |

**See also:**

- [getPersistedUriPermissions()](https://developer.android.com/reference/android/content/ContentResolver#getPersistedUriPermissions())  

### uncanonicalize

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Uri uncanonicalize (Uri url)
```

Given a canonical Uri previously generated by[canonicalize(Uri)](https://developer.android.com/reference/android/content/ContentResolver#canonicalize(android.net.Uri)), convert it to its local non-canonical form. This can be useful in some cases where you know that you will only be using the Uri in the current environment and want to avoid any possible overhead when using it with the content provider or want to verify that the referenced data exists at all in the new environment.

<br />

|                                                                                     Parameters                                                                                     ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `url` | `Uri`: The canonical[Uri](https://developer.android.com/reference/android/net/Uri)that is to be convered back to its non-canonical form. This value cannot be`null`. <br /> |

|                                                                                                                                                                              Returns                                                                                                                                                                               ||
|----------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Uri](https://developer.android.com/reference/android/net/Uri) | Returns the non-canonical representation of<var translate="no">url</var>. This will return null if data identified by the canonical Uri can not be found in the current environment; callers must always check for null and deal with that by appropriately falling back to an alternative. <br /> |

**See also:**

- [canonicalize(Uri)](https://developer.android.com/reference/android/content/ContentResolver#canonicalize(android.net.Uri))  

### unregisterContentObserver

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final void unregisterContentObserver (ContentObserver observer)
```

Unregisters a change observer.

<br />

|                                                           Parameters                                                           ||
|------------|--------------------------------------------------------------------------------------------------------------------|
| `observer` | `ContentObserver`: The previously registered observer that is no longer needed. This value cannot be`null`. <br /> |

**See also:**

- [registerContentObserver(Uri, boolean, ContentObserver)](https://developer.android.com/reference/android/content/ContentResolver#registerContentObserver(android.net.Uri,%20boolean,%20android.database.ContentObserver))  

### update

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int update (Uri uri, 
                ContentValues values, 
                Bundle extras)
```

Update row(s) in a content URI. If the content provider supports transactions the update will be atomic.

<br />

|                                                                                                                                                                                                         Parameters                                                                                                                                                                                                         ||
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`    | `Uri`: The URI to modify. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                     |
| `values` | `ContentValues`: The new field values. The key is the column name for the field. A null value will remove an existing field value. <br />                                                                                                                                                                                                                                                                        |
| `extras` | `Bundle`: A Bundle containing additional information necessary for the operation. Arguments may include SQL style arguments, such as[ContentResolver.QUERY_ARG_SQL_LIMIT](https://developer.android.com/reference/android/content/ContentResolver#QUERY_ARG_SQL_LIMIT), but note that the documentation for each individual provider will indicate which arguments they support. This value may be`null`. <br /> |

|                  Returns                  ||
|-------|------------------------------------|
| `int` | the number of rows updated. <br /> |

|                                                                                     Throws                                                                                     ||
|--------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException)         | if uri or values are null                                              |
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) | if the provider doesn't support one of the requested Bundle arguments. |

### update

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int update (Uri uri, 
                ContentValues values, 
                String where, 
                String[] selectionArgs)
```

Update row(s) in a content URI. If the content provider supports transactions the update will be atomic.

<br />

|                                                                              Parameters                                                                              ||
|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`           | `Uri`: The URI to modify. This value cannot be`null`. <br />                                                                                        |
| `values`        | `ContentValues`: The new field values. The key is the column name for the field. A null value will remove an existing field value. <br />           |
| `where`         | `String`: A filter to apply to rows before updating, formatted as an SQL WHERE clause (excluding the WHERE itself). This value may be`null`. <br /> |
| `selectionArgs` | `String`: This value may be`null`. <br />                                                                                                           |

|                  Returns                  ||
|-------|------------------------------------|
| `int` | the number of rows updated. <br /> |

|                                                          Throws                                                           ||
|------------------------------------------------------------------------------------------------|---------------------------|
| [NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException) | if uri or values are null |

### validateSyncExtrasBundle

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static void validateSyncExtrasBundle (Bundle extras)
```

Check that only values of the following types are in the Bundle:

- Integer
- Long
- Boolean
- Float
- Double
- String
- Account
- null

<br />

<br />

|                   Parameters                   ||
|----------|--------------------------------------|
| `extras` | `Bundle`: the Bundle to check <br /> |

### wrap

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static ContentResolver wrap (ContentProviderClient wrapped)
```

Create a[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)instance that redirects all its methods to the given[ContentProviderClient](https://developer.android.com/reference/android/content/ContentProviderClient).

<br />

|                               Parameters                               ||
|-----------|-------------------------------------------------------------|
| `wrapped` | `ContentProviderClient`: This value cannot be`null`. <br /> |

|                                                            Returns                                                             ||
|--------------------------------------------------------------------------------------------|------------------------------------|
| [ContentResolver](https://developer.android.com/reference/android/content/ContentResolver) | This value cannot be`null`. <br /> |

### wrap

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static ContentResolver wrap (ContentProvider wrapped)
```

Create a[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)instance that redirects all its methods to the given[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider).

<br />

|                            Parameters                            ||
|-----------|-------------------------------------------------------|
| `wrapped` | `ContentProvider`: This value cannot be`null`. <br /> |

|                                                            Returns                                                             ||
|--------------------------------------------------------------------------------------------|------------------------------------|
| [ContentResolver](https://developer.android.com/reference/android/content/ContentResolver) | This value cannot be`null`. <br /> |