android.content
Class ContentProvider

java.lang.Object
  extended by android.content.ContentProvider
All Implemented Interfaces:
ComponentCallbacks, ComponentCallbacks2
Direct Known Subclasses:
SearchRecentSuggestionsProvider

public abstract class ContentProvider
extends Object
implements ComponentCallbacks2


Nested Class Summary
static interface ContentProvider.PipeDataWriter<T>
           
 
Field Summary
 
Fields inherited from interface android.content.ComponentCallbacks2
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_UI_HIDDEN
 
Constructor Summary
ContentProvider()
           
 
Method Summary
 ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations)
           
 void attachInfo(Context context, ProviderInfo info)
           
 int bulkInsert(Uri uri, ContentValues[] values)
           
 Bundle call(String method, String arg, Bundle extras)
           
abstract  int delete(Uri uri, String selection, String[] selectionArgs)
           
 Context getContext()
           
 PathPermission[] getPathPermissions()
           
 String getReadPermission()
           
 String[] getStreamTypes(Uri uri, String mimeTypeFilter)
           
abstract  String getType(Uri uri)
           
 String getWritePermission()
           
abstract  Uri insert(Uri uri, ContentValues values)
           
protected  boolean isTemporary()
           
 void onConfigurationChanged(Configuration newConfig)
           
abstract  boolean onCreate()
           
 void onLowMemory()
           
 void onTrimMemory(int level)
           
 AssetFileDescriptor openAssetFile(Uri uri, String mode)
           
 ParcelFileDescriptor openFile(Uri uri, String mode)
           
protected  ParcelFileDescriptor openFileHelper(Uri uri, String mode)
           
<T> ParcelFileDescriptor
openPipeHelper(Uri uri, String mimeType, Bundle opts, T args, ContentProvider.PipeDataWriter<T> func)
           
 AssetFileDescriptor openTypedAssetFile(Uri uri, String mimeTypeFilter, Bundle opts)
           
abstract  Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)
           
protected  void setPathPermissions(PathPermission[] permissions)
           
protected  void setReadPermission(String permission)
           
protected  void setWritePermission(String permission)
           
 void shutdown()
           
abstract  int update(Uri uri, ContentValues values, String selection, String[] selectionArgs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentProvider

public ContentProvider()
Method Detail

getContext

public final Context getContext()

setReadPermission

protected final void setReadPermission(String permission)

getReadPermission

public final String getReadPermission()

setWritePermission

protected final void setWritePermission(String permission)

getWritePermission

public final String getWritePermission()

setPathPermissions

protected final void setPathPermissions(PathPermission[] permissions)

getPathPermissions

public final PathPermission[] getPathPermissions()

onCreate

public abstract boolean onCreate()

onConfigurationChanged

public void onConfigurationChanged(Configuration newConfig)
Specified by:
onConfigurationChanged in interface ComponentCallbacks

onLowMemory

public void onLowMemory()
Specified by:
onLowMemory in interface ComponentCallbacks

onTrimMemory

public void onTrimMemory(int level)
Specified by:
onTrimMemory in interface ComponentCallbacks2

query

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

getType

public abstract String getType(Uri uri)

insert

public abstract Uri insert(Uri uri,
                           ContentValues values)

bulkInsert

public int bulkInsert(Uri uri,
                      ContentValues[] values)

delete

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

update

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

openFile

public ParcelFileDescriptor openFile(Uri uri,
                                     String mode)
                              throws FileNotFoundException
Throws:
FileNotFoundException

openAssetFile

public AssetFileDescriptor openAssetFile(Uri uri,
                                         String mode)
                                  throws FileNotFoundException
Throws:
FileNotFoundException

openFileHelper

protected final ParcelFileDescriptor openFileHelper(Uri uri,
                                                    String mode)
                                             throws FileNotFoundException
Throws:
FileNotFoundException

getStreamTypes

public String[] getStreamTypes(Uri uri,
                               String mimeTypeFilter)

openTypedAssetFile

public AssetFileDescriptor openTypedAssetFile(Uri uri,
                                              String mimeTypeFilter,
                                              Bundle opts)
                                       throws FileNotFoundException
Throws:
FileNotFoundException

openPipeHelper

public <T> ParcelFileDescriptor openPipeHelper(Uri uri,
                                               String mimeType,
                                               Bundle opts,
                                               T args,
                                               ContentProvider.PipeDataWriter<T> func)
                                    throws FileNotFoundException
Throws:
FileNotFoundException

isTemporary

protected boolean isTemporary()

attachInfo

public void attachInfo(Context context,
                       ProviderInfo info)

applyBatch

public ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations)
                                   throws OperationApplicationException
Throws:
OperationApplicationException

call

public Bundle call(String method,
                   String arg,
                   Bundle extras)

shutdown

public void shutdown()


Copyright © 2008-2012. All Rights Reserved.