public class

ContentProviderClient

extends Object
java.lang.Object
   ↳ android.content.ContentProviderClient

Class Overview

The public interface object used to interact with a ContentProvider. This is obtained by calling acquireContentProviderClient(Uri). This object must be released using release() in order to indicate to the system that the ContentProvider is no longer needed and can be killed to free up resources.

Summary

Public Methods
ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations)
int bulkInsert(Uri url, ContentValues[] initialValues)
int delete(Uri url, String selection, String[] selectionArgs)
ContentProvider getLocalContentProvider()
Get a reference to the ContentProvider that is associated with this client.
String getType(Uri url)
Uri insert(Uri url, ContentValues initialValues)
AssetFileDescriptor openAssetFile(Uri url, String mode)
ParcelFileDescriptor openFile(Uri url, String mode)
Cursor query(Uri url, String[] projection, String selection, String[] selectionArgs, String sortOrder)
boolean release()
Call this to indicate to the system that the associated ContentProvider is no longer needed by this ContentProviderClient.
int update(Uri url, ContentValues values, String selection, String[] selectionArgs)
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public int bulkInsert (Uri url, ContentValues[] initialValues)

Since: API Level 5

public int delete (Uri url, String selection, String[] selectionArgs)

Since: API Level 5

public ContentProvider getLocalContentProvider ()

Since: API Level 5

Get a reference to the ContentProvider that is associated with this client. If the ContentProvider is running in a different process then null will be returned. This can be used if you know you are running in the same process as a provider, and want to get direct access to its implementation details.

Returns
  • If the associated ContentProvider is local, returns it. Otherwise returns null.

public String getType (Uri url)

Since: API Level 5

public Uri insert (Uri url, ContentValues initialValues)

Since: API Level 5

public Cursor query (Uri url, String[] projection, String selection, String[] selectionArgs, String sortOrder)

Since: API Level 5

public boolean release ()

Since: API Level 5

Call this to indicate to the system that the associated ContentProvider is no longer needed by this ContentProviderClient.

Returns
  • true if this was release, false if it was already released

public int update (Uri url, ContentValues values, String selection, String[] selectionArgs)

Since: API Level 5