Added in API level 1
android.content
Contains classes for accessing and publishing data on a device. It includes three main categories of APIs:
- Content sharing (
android.content
) - For sharing content between application components. The most important classes are:
ContentProvider
andContentResolver
for managing and publishing persistent data associated with an application.Intent
andIntentFilter
, for delivering structured messages between different application components—allowing components to initiate other components and return results.
- Package management (
android.content.pm
) - For accessing information about an Android package (an
.apk
), including information about its activities, permissions, services, signatures, and providers. The most important class for accessing this information isPackageManager
. - Resource management (
android.content.res
) - For retrieving resource data associated with an application, such as strings, drawables,
media, and device configuration details. The most important class for accessing this data is
Resources
.
Interfaces
ClipboardManager.OnPrimaryClipChangedListener | Defines a listener callback that is invoked when the primary clip on the clipboard changes. |
ComponentCallbacks |
The set of callback APIs that are common to all application components
(Activity , Service ,
ContentProvider , and Application ).
|
ComponentCallbacks2 |
Extended ComponentCallbacks interface with a new callback for
finer-grained memory management.
|
ContentProvider.PipeDataWriter<T> | Interface to write a stream of data to a pipe. |
DialogInterface | Interface that defines a dialog-type class that can be shown, dismissed, or canceled, and may have buttons that can be clicked. |
DialogInterface.OnCancelListener | Interface used to allow the creator of a dialog to run some code when the dialog is canceled. |
DialogInterface.OnClickListener | Interface used to allow the creator of a dialog to run some code when an item on the dialog is clicked. |
DialogInterface.OnDismissListener | Interface used to allow the creator of a dialog to run some code when the dialog is dismissed. |
DialogInterface.OnKeyListener | Interface definition for a callback to be invoked when a key event is dispatched to this dialog. |
DialogInterface.OnMultiChoiceClickListener | Interface used to allow the creator of a dialog to run some code when an item in a multi-choice dialog is clicked. |
DialogInterface.OnShowListener | Interface used to allow the creator of a dialog to run some code when the dialog is shown. |
EntityIterator |
A specialization of Iterator that allows iterating over a collection of
Entity objects.
|
IntentSender.OnFinished | Callback interface for discovering when a send operation has completed. |
Loader.OnLoadCanceledListener<D> |
This interface was deprecated
in API level 28.
Use Loader.OnLoadCanceledListener
|
Loader.OnLoadCompleteListener<D> |
This interface was deprecated
in API level 28.
Use Loader.OnLoadCompleteListener
|
ServiceConnection | Interface for monitoring the state of an application service. |
SharedPreferences |
Interface for accessing and modifying preference data returned by Context.getSharedPreferences(String, int) .
|
SharedPreferences.Editor |
Interface used for modifying values in a SharedPreferences
object.
|
SharedPreferences.OnSharedPreferenceChangeListener | Interface definition for a callback to be invoked when a shared preference is changed. |
SyncStatusObserver |
Classes
AbstractThreadedSyncAdapter | An abstract implementation of a SyncAdapter that spawns a thread to invoke a sync operation. |
AsyncQueryHandler |
A helper class to help make handling asynchronous ContentResolver
queries easier.
|
AsyncQueryHandler.WorkerArgs | |
AsyncQueryHandler.WorkerHandler | |
AsyncTaskLoader<D> |
This class was deprecated
in API level 28.
Use the Support Library
AsyncTaskLoader
|
AttributionSource | This class represents a source to which access to permission protected data should be attributed. |
AttributionSource.Builder |
A builder for AttributionSource
|
BroadcastReceiver |
Base class for code that receives and handles broadcast intents sent by
Context.sendBroadcast(Intent) .
|
BroadcastReceiver.PendingResult | State for a result that is pending for a broadcast receiver. |
ClipboardManager | Interface to the clipboard service, for placing and retrieving text in the global clipboard. |
ClipData | Representation of a clipped data on the clipboard. |
ClipData.Item | Description of a single item in a ClipData. |
ClipData.Item.Builder | A builder for a ClipData Item. |
ClipDescription |
Meta-data describing the contents of a ClipData .
|
ComponentName |
Identifier for a specific application component
(Activity , Service ,
BroadcastReceiver , or
ContentProvider ) that is available.
|
ContentProvider | Content providers are one of the primary building blocks of Android applications, providing content to applications. |
ContentProvider.CallingIdentity | Opaque token representing the identity of an incoming IPC. |
ContentProviderClient |
The public interface object used to interact with a specific
ContentProvider .
|
ContentProviderOperation | Represents a single operation to be performed as part of a batch of operations. |
ContentProviderOperation.Builder |
Used to add parameters to a ContentProviderOperation .
|
ContentProviderResult |
Contains the result of the application of a ContentProviderOperation .
|
ContentQueryMap | Caches the contents of a cursor into a Map of String->ContentValues and optionally keeps the cache fresh by registering for updates on the content backing the cursor. |
ContentResolver | This class provides applications access to the content model. |
ContentResolver.MimeTypeInfo | Detailed description of a specific MIME type, including an icon and label that describe the type. |
ContentUris |
Utility methods useful for working with Uri objects
that use the "content" (content://) scheme.
|
ContentValues |
This class is used to store a set of values that the ContentResolver
can process.
|
Context | Interface to global information about an application environment. |
Context.BindServiceFlags | Specific flags used for bindService() call, which encapsulates a 64 bits long integer. |
ContextParams |
This class represents rules around how a context being created via
Context.createContext should behave.
|
ContextParams.Builder |
Builder for creating a ContextParams .
|
ContextWrapper | Proxying implementation of Context that simply delegates all of its calls to another Context. |
CursorLoader |
This class was deprecated
in API level 28.
Use the Support Library
CursorLoader
|
Entity | A representation of a item using ContentValues. |
Entity.NamedContentValues | |
Intent | An intent is an abstract description of an operation to be performed. |
Intent.FilterComparison | Wrapper class holding an Intent and implementing comparisons on it for the purpose of filtering. |
Intent.ShortcutIconResource | Represents a shortcut/live folder icon resource. |
IntentFilter | Structured description of Intent values to be matched. |
IntentFilter.AuthorityEntry |
This is an entry for a single authority in the Iterator returned by
IntentFilter.authoritiesIterator() .
|
IntentSender | A description of an Intent and target action to perform with it. |
Loader<D> |
This class was deprecated
in API level 28.
Use the Support Library
Loader
|
Loader.ForceLoadContentObserver |
This class was deprecated
in API level 28.
Use Loader.ForceLoadContentObserver
|
LocusId | An identifier for an unique state (locus) in the application. |
MutableContextWrapper |
Special version of ContextWrapper that allows the base context to
be modified after it is initially set.
|
PeriodicSync | Value type that contains information about a periodic sync. |
QuickViewConstants |
Constants for Intent.ACTION_QUICK_VIEW .
|
RestrictionEntry | Applications can expose restrictions for a restricted user on a multiuser device. |
RestrictionsManager | Provides a mechanism for apps to query restrictions imposed by an entity that manages the user. |
SearchRecentSuggestionsProvider | This superclass can be used to create a simple search suggestions provider for your application. |
SyncAdapterType | Value type that represents a SyncAdapterType. |
SyncContext | |
SyncInfo | Information about the sync operation that is currently underway. |
SyncRequest | Convenience class to construct sync requests. |
SyncRequest.Builder |
Builder class for a SyncRequest .
|
SyncResult | This class is used to communicate the results of a sync operation to the SyncManager. |
SyncStats | Used to record various statistics about the result of a sync operation. |
UriMatcher | Utility class to aid in matching URIs in content providers. |
UriPermission | Description of a single Uri permission grant. |
UriRelativeFilter |
A filter for matching Intent URI Data as part of a
UriRelativeFilterGroup .
|
UriRelativeFilterGroup | An intent data matching group based on a URI's relative reference which includes the path, query and fragment. |
Exceptions
ActivityNotFoundException |
This exception is thrown when a call to Context.startActivity or
one of its variants fails because an Activity can not be found to execute
the given Intent.
|
IntentFilter.MalformedMimeTypeException | This exception is thrown when a given MIME type does not have a valid syntax. |
IntentSender.SendIntentException | Exception thrown when trying to send through a PendingIntent that has been canceled or is otherwise no longer able to execute the request. |
OperationApplicationException |
Thrown when an application of a ContentProviderOperation fails due the specified
constraints.
|
ReceiverCallNotAllowedException |
This exception is thrown from Context.registerReceiver and
Context.bindService when these methods are being used from
an BroadcastReceiver component.
|
Interfaces
- ClipboardManager.OnPrimaryClipChangedListener
- ComponentCallbacks
- ComponentCallbacks2
- ContentProvider.PipeDataWriter
- DialogInterface
- DialogInterface.OnCancelListener
- DialogInterface.OnClickListener
- DialogInterface.OnDismissListener
- DialogInterface.OnKeyListener
- DialogInterface.OnMultiChoiceClickListener
- DialogInterface.OnShowListener
- EntityIterator
- IntentSender.OnFinished
- Loader.OnLoadCanceledListener
- Loader.OnLoadCompleteListener
- ServiceConnection
- SharedPreferences
- SharedPreferences.Editor
- SharedPreferences.OnSharedPreferenceChangeListener
- SyncStatusObserver
Classes
- AbstractThreadedSyncAdapter
- AsyncQueryHandler
- AsyncQueryHandler.WorkerArgs
- AsyncQueryHandler.WorkerHandler
- AsyncTaskLoader
- AttributionSource
- AttributionSource.Builder
- BroadcastReceiver
- BroadcastReceiver.PendingResult
- ClipboardManager
- ClipData
- ClipData.Item
- ClipData.Item.Builder
- ClipDescription
- ComponentName
- ContentProvider
- ContentProvider.CallingIdentity
- ContentProviderClient
- ContentProviderOperation
- ContentProviderOperation.Builder
- ContentProviderResult
- ContentQueryMap
- ContentResolver
- ContentResolver.MimeTypeInfo
- ContentUris
- ContentValues
- Context
- Context.BindServiceFlags
- ContextParams
- ContextParams.Builder
- ContextWrapper
- CursorLoader
- Entity
- Entity.NamedContentValues
- Intent
- Intent.FilterComparison
- Intent.ShortcutIconResource
- IntentFilter
- IntentFilter.AuthorityEntry
- IntentSender
- Loader
- Loader.ForceLoadContentObserver
- LocusId
- MutableContextWrapper
- PeriodicSync
- QuickViewConstants
- RestrictionEntry
- RestrictionsManager
- SearchRecentSuggestionsProvider
- SyncAdapterType
- SyncContext
- SyncInfo
- SyncRequest
- SyncRequest.Builder
- SyncResult
- SyncStats
- UriMatcher
- UriPermission
- UriRelativeFilter
- UriRelativeFilterGroup
Exceptions