Java android.content ContentResolver fields, constructors, methods, implement or subclass

Example usage for Java android.content ContentResolver fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.content ContentResolver.

The text is from its open source code.

Field

StringSYNC_EXTRAS_ACCOUNT
StringSYNC_EXTRAS_EXPEDITED
If this extra is set to true, the sync request will be scheduled at the front of the sync request queue and without any delay
StringSYNC_EXTRAS_FORCE
StringSYNC_EXTRAS_IGNORE_SETTINGS
If this extra is set to true then the sync settings (like getSyncAutomatically()) are ignored by the sync scheduler.
StringSYNC_EXTRAS_IGNORE_BACKOFF
If this extra is set to true then any backoffs for the initial attempt (e.g.
StringSYNC_EXTRAS_DO_NOT_RETRY
If this extra is set to true then the request will not be retried if it fails.
StringSYNC_EXTRAS_MANUAL
Setting this extra is the equivalent of setting both #SYNC_EXTRAS_IGNORE_SETTINGS and #SYNC_EXTRAS_IGNORE_BACKOFF
StringSYNC_EXTRAS_UPLOAD
Indicates that this sync is intended to only upload local changes to the server.
StringSYNC_EXTRAS_INITIALIZE
Set by the SyncManager to request that the SyncAdapter initialize itself for the given account/authority pair.
StringSCHEME_CONTENT
StringSCHEME_ANDROID_RESOURCE
StringSCHEME_FILE
StringCURSOR_ITEM_BASE_TYPE
This is the Android platform's base MIME type for a content: URI containing a Cursor of a single item.
StringCURSOR_DIR_BASE_TYPE
This is the Android platform's base MIME type for a content: URI containing a Cursor of zero or more items.
intSYNC_OBSERVER_TYPE_SETTINGS
intSYNC_OBSERVER_TYPE_PENDING
intSYNC_OBSERVER_TYPE_ACTIVE

Method

ContentProviderClientacquireContentProviderClient(@NonNull Uri uri)
Returns a ContentProviderClient that is associated with the ContentProvider that services the content at uri, starting the provider if necessary.
ContentProviderClientacquireContentProviderClient(@NonNull String name)
Returns a ContentProviderClient that is associated with the ContentProvider with the authority of name, starting the provider if necessary.
IContentProvideracquireProvider(Uri uri)
Returns the content provider for the given content URI.
IContentProvideracquireProvider(String name)
voidaddPeriodicSync(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.
ObjectaddStatusChangeListener(int mask, final SyncStatusObserver callback)
Request notifications when the different aspects of the SyncManager change.
ContentProviderResult[]applyBatch(@NonNull String authority, @NonNull ArrayList operations)
Applies each of the ContentProviderOperation objects and returns an array of their results.
intbulkInsert(@RequiresPermission.Write @NonNull Uri url, @NonNull ContentValues[] values)
Inserts multiple rows into a table at the given URL.
Bundlecall(@NonNull Uri uri, @NonNull String method, @Nullable String arg, @Nullable Bundle extras)
Call a provider-defined method.
voidcancelSync(Account account, String authority)
Cancel any active or pending syncs that match account and authority.
intdelete(@RequiresPermission.Write @NonNull Uri url, @Nullable String where, @Nullable String[] selectionArgs)
Deletes row(s) specified by a content URI.
ClassgetClass()
Returns the runtime class of this Object .
ListgetCurrentSyncs()
Returns a list with information about all the active syncs.
intgetIsSyncable(Account account, String authority)
Check if this account/provider is syncable.
booleangetMasterSyncAutomatically()
Gets the master auto-sync setting that applies to all the providers and accounts.
ListgetPeriodicSyncs(Account account, String authority)
Get the list of information about the periodic syncs for the given account and authority.
ListgetPersistedUriPermissions()
Return list of all URI permission grants that have been persisted by the calling app.
String[]getStreamTypes(@NonNull Uri url, @NonNull 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 .
SyncAdapterType[]getSyncAdapterTypes()
Get information about the SyncAdapters that are known to the system.
booleangetSyncAutomatically(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 android.Manifest.permission#READ_SYNC_SETTINGS .

StringgetType(@NonNull Uri url)
Return the MIME type of the given content URL.
Uriinsert(@RequiresPermission.Write @NonNull Uri url, @Nullable ContentValues values)
Inserts a row into a table at the given URL.
booleanisSyncActive(Account account, String authority)
Returns true if there is currently a sync operation for the given account or authority actively being processed.
booleanisSyncPending(Account account, String authority)
Return true if the pending status is true of any matching authorities.
voidnotifyChange(@NonNull Uri uri, @Nullable ContentObserver observer)
Notify registered observers that a row was updated and attempt to sync changes to the network.
voidnotifyChange(@NonNull Uri uri, @Nullable ContentObserver observer, boolean syncToNetwork)
Notify registered observers that a row was updated.
voidnotifyChange(@NonNull Uri uri, @Nullable ContentObserver observer, @NotifyFlags int flags)
Notify registered observers that a row was updated.
AssetFileDescriptoropenAssetFileDescriptor(@NonNull Uri uri, @NonNull String mode)
Open a raw file descriptor to access data under a URI.
ParcelFileDescriptoropenFileDescriptor(@NonNull Uri uri, @NonNull String mode)
Open a raw file descriptor to access data under a URI.
InputStreamopenInputStream(@NonNull Uri uri)
Open a stream on to the content associated with a content URI.
OutputStreamopenOutputStream(@NonNull Uri uri)
Synonym for #openOutputStream(Uri,String) openOutputStream(uri, "w") .
OutputStreamopenOutputStream(@NonNull Uri uri, @NonNull String mode)
Open a stream on to the content associated with a content URI.
AssetFileDescriptoropenTypedAssetFileDescriptor(@NonNull Uri uri, @NonNull String mimeType, @Nullable Bundle opts)
Open a raw file descriptor to access (potentially type transformed) data from a "content:" URI.
Cursorquery(@RequiresPermission.Read @NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder)
Query the given URI, returning a Cursor over the result set.
Cursorquery(@RequiresPermission.Read @NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder, @Nullable CancellationSignal cancellationSignal)
Query the given URI, returning a Cursor over the result set with optional support for cancellation.
Cursorquery(final @RequiresPermission.Read @NonNull Uri uri, @Nullable String[] projection, @Nullable Bundle queryArgs, @Nullable CancellationSignal cancellationSignal)
Query the given URI, returning a Cursor over the result set with support for cancellation.
voidregisterContentObserver(@NonNull Uri uri, boolean notifyForDescendants, @NonNull ContentObserver observer)
Register an observer class that gets callbacks when data identified by a given content URI changes.
voidremovePeriodicSync(Account account, String authority, Bundle extras)
Remove a periodic sync.
voidremoveStatusChangeListener(Object handle)
Remove a previously registered status change listener.
voidrequestSync(Account account, String authority, Bundle extras)
Start an asynchronous sync operation.
voidrequestSync(SyncRequest request)
Register a sync with the SyncManager.
voidsetIsSyncable(Account account, String authority, int syncable)
Set whether this account/provider is syncable.
voidsetMasterSyncAutomatically(boolean sync)
Sets the master auto-sync setting that applies to all the providers and accounts.
voidsetSyncAutomatically(Account account, String authority, boolean sync)
Set whether or not the provider is synced when it receives a network tickle.
voidstartSync(Uri uri, Bundle extras)
Start an asynchronous sync operation.
voidtakePersistableUriPermission(@NonNull Uri uri, @Intent.AccessUriMode int modeFlags)
Take a persistable URI permission grant that has been offered.
voidunregisterContentObserver(@NonNull ContentObserver observer)
Unregisters a change observer.
intupdate(@RequiresPermission.Write @NonNull Uri uri, @Nullable ContentValues values, @Nullable String where, @Nullable String[] selectionArgs)
Update row(s) in a content URI.