java.lang.Object | ||
android.content.Intent | Parcelable |
An intent is an abstract description of an operation to be performed. It can be used with startActivity to launch an Activity, broadcastIntent to send it to any interested BroadcastReceiver components, and startService(Intent) or bindService(Intent, ServiceConnection, int) to communicate with a background Service.
An Intent provides a facility for performing late runtime binding between the code in different applications. Its most significant use is in the launching of activities, where it can be thought of as the glue between activities. It is basically a passive data structure holding an abstract description of an action to be performed. The primary pieces of information in an intent are:
action -- The general action to be performed, such as ACTION_VIEW, ACTION_EDIT, ACTION_MAIN, etc.
data -- The data to operate on, such as a person record in the contacts database, expressed as a Uri.
Some examples of action/data pairs are:
ACTION_VIEW content://contacts/1 -- Display information about the person whose identifier is "1".
ACTION_DIAL content://contacts/1 -- Display the phone dialer with the person filled in.
ACTION_VIEW tel:123 -- Display the phone dialer with the given number filled in. Note how the VIEW action does what what is considered the most reasonable thing for a particular URI.
ACTION_DIAL tel:123 -- Display the phone dialer with the given number filled in.
ACTION_EDIT content://contacts/1 -- Edit information about the person whose identifier is "1".
ACTION_VIEW content://contacts/ -- Display a list of people, which the user can browse through. This example is a typical top-level entry into the Contacts application, showing you the list of people. Selecting a particular person to view would result in a new intent { ACTION_VIEW content://contacts/N } being used to start an activity to display that person.
In addition to these primary attributes, there are a number of secondary attributes that you can also include with an intent:
category -- Gives additional information about the action to execute. For example, CATEGORY_LAUNCHER means it should appear in the Launcher as a top-level application, while CATEGORY_ALTERNATIVE means it should be included in a list of alternative actions the user can perform on a piece of data.
type -- Specifies an explicit type (a MIME type) of the intent data. Normally the type is inferred from the data itself. By setting this attribute, you disable that evaluation and force an explicit type.
component -- Specifies an explicit name of a component class to use for the intent. Normally this is determined by looking at the other information in the intent (the action, data/type, and categories) and matching that with a component that can handle it. If this attribute is set then none of the evaluation is performed, and this component is used exactly as is. By specifying this attribute, all of the other Intent attributes become optional.
extras -- This is a Bundle of any additional information. This can be used to provide extended information to the component. For example, if we have a action to send an e-mail message, we could also include extra pieces of data here to supply a subject, body, etc.
Here are some examples of other operations you can specify as intents using these additional parameters:
ACTION_MAIN with category CATEGORY_HOME -- Launch the home screen.
ACTION_GET_CONTENT with MIME type vnd.android.cursor.item/phone -- Display the list of people's phone numbers, allowing the user to browse through them and pick one and return it to the parent activity.
ACTION_GET_CONTENT with MIME type */* and category CATEGORY_OPENABLE -- Display all pickers for data that can be opened with ContentResolver.openInputStream(), allowing the user to pick one of them and then some data inside of it and returning the resulting URI to the caller. This can be used, for example, in an e-mail application to allow the user to pick some data to include as an attachment.
There are a variety of standard Intent action and category constants defined in the Intent class, but applications can also define their own. These strings use Java style scoping, to ensure they are unique -- for example, the standard ACTION_VIEW is called "android.app.action.VIEW".
Put together, the set of actions, data types, categories, and extra data defines a language for the system allowing for the expression of phrases such as "call john smith's cell". As applications are added to the system, they can extend this language by adding new actions, types, and categories, or they can modify the behavior of existing phrases by supplying their own activities that handle them.
There are two primary forms of intents you will use.
Explicit Intents have specified a component (via setComponent(ComponentName) or setClass(Context, Class>)), which provides the exact class to be run. Often these will not include any other information, simply being a way for an application to launch various internal activities it has as the user interacts with the application.
Implicit Intents have not specified a component; instead, they must include enough information for the system to determine which of the available components is best to run for that intent.
When using implicit intents, given such an arbitrary intent we need to know what to do with it. This is handled by the process of Intent resolution, which maps an Intent to an Activity, BroadcastReceiver, or Service (or sometimes two or more activities/receivers) that can handle it.
The intent resolution mechanism basically revolves around matching an Intent against all of the <intent-filter> descriptions in the installed application packages. (Plus, in the case of broadcasts, any BroadcastReceiver objects explicitly registered with registerReceiver(BroadcastReceiver, IntentFilter).) More details on this can be found in the documentation on the IntentFilter class.
There are three pieces of information in the Intent that are used for
resolution: the action, type, and category. Using this information, a query
is done on the PackageManager for a component that can handle the
intent. The appropriate component is determined based on the intent
information supplied in the AndroidManifest.xml
file as
follows:
The action, if given, must be listed by the component as one it handles.
The type is retrieved from the Intent's data, if not already supplied in the Intent. Like the action, if a type is included in the intent (either explicitly or implicitly in its data), then this must be listed by the component as one it handles.
content:
URI and where no explicit
type is included in the Intent, instead the scheme of the
intent data (such as http:
or mailto:
) is
considered. Again like the action, if we are matching a scheme it
must be listed by the component as one it can handle.
The categories, if supplied, must all be listed by the activity as categories it handles. That is, if you include the categories CATEGORY_LAUNCHER and CATEGORY_ALTERNATIVE, then you will only resolve to components with an intent that lists both of those categories. Activities will very often need to support the CATEGORY_DEFAULT so that they can be found by Context.startActivity().
For example, consider the Note Pad sample application that allows user to browse through a list of notes data and view details about individual items. Text in italics indicate places were you would replace a name with one specific to your own package.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.notepad"> <application android:icon="@drawable/app_notes" android:label="@string/app_name"> <provider class=".NotePadProvider" android:authorities="com.google.provider.NotePad" /> <activity class=".NotesList" android:label="@string/title_notes_list"> <intent-filter> <action android:value="android.intent.action.MAIN" /> <category android:value="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:value="android.intent.action.VIEW" /> <action android:value="android.intent.action.EDIT" /> <action android:value="android.intent.action.PICK" /> <category android:value="android.intent.category.DEFAULT" /> <type android:value="vnd.android.cursor.dir/vnd.google.note" /> </intent-filter> <intent-filter> <action android:value="android.intent.action.GET_CONTENT" /> <category android:value="android.intent.category.DEFAULT" /> <type android:value="vnd.android.cursor.item/vnd.google.note" /> </intent-filter> </activity> <activity class=".NoteEditor" android:label="@string/title_note"> <intent-filter android:label="@string/resolve_edit"> <action android:value="android.intent.action.VIEW" /> <action android:value="android.intent.action.EDIT" /> <category android:value="android.intent.category.DEFAULT" /> <type android:value="vnd.android.cursor.item/vnd.google.note" /> </intent-filter> <intent-filter> <action android:value="android.intent.action.INSERT" /> <category android:value="android.intent.category.DEFAULT" /> <type android:value="vnd.android.cursor.dir/vnd.google.note" /> </intent-filter> </activity> <activity class=".TitleEditor" android:label="@string/title_edit_title" android:theme="@android:style/Theme.Dialog"> <intent-filter android:label="@string/resolve_title"> <action android:value="com.android.notepad.action.EDIT_TITLE" /> <category android:value="android.intent.category.DEFAULT" /> <category android:value="android.intent.category.ALTERNATIVE" /> <category android:value="android.intent.category.SELECTED_ALTERNATIVE" /> <type android:value="vnd.android.cursor.item/vnd.google.note" /> </intent-filter> </activity> </application> </manifest>
The first activity,
com.android.notepad.NotesList
, serves as our main
entry into the app. It can do three things as described by its three intent
templates:
<intent-filter> <action android:value="android.intent.action.MAIN" /> <category android:value="android.intent.category.LAUNCHER" /> </intent-filter>
This provides a top-level entry into the NotePad application: the standard MAIN action is a main entry point (not requiring any other information in the Intent), and the LAUNCHER category says that this entry point should be listed in the application launcher.
<intent-filter> <action android:value="android.intent.action.VIEW" /> <action android:value="android.intent.action.EDIT" /> <action android:value="android.intent.action.PICK" /> <category android:value="android.intent.category.DEFAULT" /> <type android:value="vnd.android.cursor.dir/vnd.google.note" /> </intent-filter>
This declares the things that the activity can do on a directory of
notes. The type being supported is given with the <type> tag, where
vnd.android.cursor.dir/vnd.google.note
is a URI from which
a Cursor of zero or more items (vnd.android.cursor.dir
) can
be retrieved which holds our note pad data (vnd.google.note
).
The activity allows the user to view or edit the directory of data (via
the VIEW and EDIT actions), or to pick a particular note and return it
to the caller (via the PICK action). Note also the DEFAULT category
supplied here: this is required for the
Context.startActivity method to resolve your
activity when its component name is not explicitly specified.
<intent-filter> <action android:value="android.intent.action.GET_CONTENT" /> <category android:value="android.intent.category.DEFAULT" /> <type android:value="vnd.android.cursor.item/vnd.google.note" /> </intent-filter>
This filter describes the ability return to the caller a note selected by
the user without needing to know where it came from. The data type
vnd.android.cursor.item/vnd.google.note
is a URI from which
a Cursor of exactly one (vnd.android.cursor.item
) item can
be retrieved which contains our note pad data (vnd.google.note
).
The GET_CONTENT action is similar to the PICK action, where the activity
will return to its caller a piece of data selected by the user. Here,
however, the caller specifies the type of data they desire instead of
the type of data the user will be picking from.
Given these capabilities, the following intents will resolve to the NotesList activity:
{ action=android.app.action.MAIN } matches all of the activities that can be used as top-level entry points into an application.
{ action=android.app.action.MAIN, category=android.app.category.LAUNCHER } is the actual intent used by the Launcher to populate its top-level list.
{ action=android.app.action.VIEW data=content://com.google.provider.NotePad/notes } displays a list of all the notes under "content://com.google.provider.NotePad/notes", which the user can browse through and see the details on.
{ action=android.app.action.PICK data=content://com.google.provider.NotePad/notes } provides a list of the notes under "content://com.google.provider.NotePad/notes", from which the user can pick a note whose data URL is returned back to the caller.
{ action=android.app.action.GET_CONTENT type=vnd.android.cursor.item/vnd.google.note } is similar to the pick action, but allows the caller to specify the kind of data they want back so that the system can find the appropriate activity to pick something of that data type.
The second activity,
com.android.notepad.NoteEditor
, shows the user a single
note entry and allows them to edit it. It can do two things as described
by its two intent templates:
<intent-filter android:label="@string/resolve_edit"> <action android:value="android.intent.action.VIEW" /> <action android:value="android.intent.action.EDIT" /> <category android:value="android.intent.category.DEFAULT" /> <type android:value="vnd.android.cursor.item/vnd.google.note" /> </intent-filter>
The first, primary, purpose of this activity is to let the user interact
with a single note, as decribed by the MIME type
vnd.android.cursor.item/vnd.google.note
. The activity can
either VIEW a note or allow the user to EDIT it. Again we support the
DEFAULT category to allow the activity to be launched without explicitly
specifying its component.
<intent-filter> <action android:value="android.intent.action.INSERT" /> <category android:value="android.intent.category.DEFAULT" /> <type android:value="vnd.android.cursor.dir/vnd.google.note" /> </intent-filter>
The secondary use of this activity is to insert a new note entry into an existing directory of notes. This is used when the user creates a new note: the INSERT action is executed on the directory of notes, causing this activity to run and have the user create the new note data which it then adds to the content provider.
Given these capabilities, the following intents will resolve to the NoteEditor activity:
{ action=android.app.action.VIEW data=content://com.google.provider.NotePad/notes/{ID} } shows the user the content of note {ID}.
{ action=android.app.action.EDIT data=content://com.google.provider.NotePad/notes/{ID} } allows the user to edit the content of note {ID}.
{ action=android.app.action.INSERT data=content://com.google.provider.NotePad/notes } creates a new, empty note in the notes list at "content://com.google.provider.NotePad/notes" and allows the user to edit it. If they keep their changes, the URI of the newly created note is returned to the caller.
The last activity,
com.android.notepad.TitleEditor
, allows the user to
edit the title of a note. This could be implemented as a class that the
application directly invokes (by explicitly setting its component in
the Intent), but here we show a way you can publish alternative
operations on existing data:
<intent-filter android:label="@string/resolve_title"> <action android:value="com.android.notepad.action.EDIT_TITLE" /> <category android:value="android.intent.category.DEFAULT" /> <category android:value="android.intent.category.ALTERNATIVE" /> <category android:value="android.intent.category.SELECTED_ALTERNATIVE" /> <type android:value="vnd.android.cursor.item/vnd.google.note" /> </intent-filter>
In the single intent template here, we
have created our own private action called
com.android.notepad.action.EDIT_TITLE
which means to
edit the title of a note. It must be invoked on a specific note
(data type vnd.android.cursor.item/vnd.google.note
) like the previous
view and edit actions, but here displays and edits the title contained
in the note data.
In addition to supporting the default category as usual, our title editor
also supports two other standard categories: ALTERNATIVE and
SELECTED_ALTERNATIVE. Implementing
these categories allows others to find the special action it provides
without directly knowing about it, through the
queryIntentActivityOptions(ComponentName, Intent[], Intent, int) method, or
more often to build dynamic menu items with
addIntentOptions(int, int, int, ComponentName, Intent[], Intent, int, MenuItem[]). Note that in the intent
template here was also supply an explicit name for the template
(via android:label="@string/resolve_title"
) to better control
what the user sees when presented with this activity as an alternative
action to the data they are viewing.
Given these capabilities, the following intent will resolve to the TitleEditor activity:
{ action=com.android.notepad.action.EDIT_TITLE data=content://com.google.provider.NotePad/notes/{ID} } displays and allows the user to edit the title associated with note {ID}.
These are the current standard actions that Intent defines for launching activities (usually through startActivity(Intent). The most important, and by far most frequently used, are ACTION_MAIN and ACTION_EDIT.
These are the current standard actions that Intent defines for receiving broadcasts (usually through registerReceiver(BroadcastReceiver, IntentFilter) or a <receiver> tag in a manifest).
These are the current standard categories that can be used to further clarify an Intent via addCategory(String).
These are the current standard fields that can be used as extra data via putExtra(String, Bundle).
These are the possible flags that can be used in the Intent via setFlags(int) and addFlags(int).
Intent.FilterComparison | Wrapper class holding an Intent and implementing comparisons on it for the purpose of filtering. |
Intent.ShortcutIconResource | Represents a shortcut icon resource. |
Value | ||||
---|---|---|---|---|
String | ACTION_AIRPLANE_MODE_CHANGED | Broadcast Action: The user has switched the phone into or out of Airplane Mode. |
"android.intent.action.AIRPLANE_MODE" | |
String | ACTION_ALL_APPS | Activity Action: List all available applications
Input: Nothing. |
"android.intent.action.ALL_APPS" | |
String | ACTION_ANSWER | Activity Action: Handle an incoming phone call. | "android.intent.action.ANSWER" | |
String | ACTION_ATTACH_DATA | Used to indicate that some piece of data should be attached to some other place. | "android.intent.action.ATTACH_DATA" | |
String | ACTION_BATTERY_CHANGED | Broadcast Action: The charging state, or charge level of the battery has changed. | "android.intent.action.BATTERY_CHANGED" | |
String | ACTION_BATTERY_LOW | Broadcast Action: Indicates low battery condition on the device. | "android.intent.action.BATTERY_LOW" | |
String | ACTION_BOOT_COMPLETED | Broadcast Action: This is broadcast once, after the system has finished booting. | "android.intent.action.BOOT_COMPLETED" | |
String | ACTION_BUG_REPORT | Activity Action: Show activity for reporting a bug. | "android.intent.action.BUG_REPORT" | |
String | ACTION_CALL | Activity Action: Perform a call to someone specified by the data. | "android.intent.action.CALL" | |
String | ACTION_CAMERA_BUTTON | Broadcast Action: The "Camera Button" was pressed. | "android.intent.action.CAMERA_BUTTON" | |
String | ACTION_CHOOSER | Activity Action: Display an activity chooser, allowing the user to pick what they want to before proceeding. | "android.intent.action.CHOOSER" | |
String | ACTION_CLOSE_SYSTEM_DIALOGS | Broadcast Action: This is broadcast when a user action should request a temporary system dialog to dismiss. | "android.intent.action.CLOSE_SYSTEM_DIALOGS" | |
String | ACTION_CONFIGURATION_CHANGED | Broadcast Action: The current device Configuration (orientation, locale, etc) has changed. | "android.intent.action.CONFIGURATION_CHANGED" | |
String | ACTION_CREATE_SHORTCUT | Activity Action: Creates a shortcut. | "android.intent.action.CREATE_SHORTCUT" | |
String | ACTION_DATE_CHANGED | Broadcast Action: The date has changed. | "android.intent.action.DATE_CHANGED" | |
String | ACTION_DEFAULT | A synonym for ACTION_VIEW, the "standard" action that is performed on a piece of data. | "android.intent.action.VIEW" | |
String | ACTION_DELETE | Activity Action: Delete the given data from its container. | "android.intent.action.DELETE" | |
String | ACTION_DEVICE_STORAGE_LOW | Broadcast Action: Indicates low memory condition on the device | "android.intent.action.DEVICE_STORAGE_LOW" | |
String | ACTION_DEVICE_STORAGE_OK | Broadcast Action: Indicates low memory condition on the device no longer exists | "android.intent.action.DEVICE_STORAGE_OK" | |
String | ACTION_DIAL | Activity Action: Dial a number as specified by the data. | "android.intent.action.DIAL" | |
String | ACTION_EDIT | Activity Action: Provide explicit editable access to the given data. | "android.intent.action.EDIT" | |
String | ACTION_FACTORY_TEST | Activity Action: Main entry point for factory tests. | "android.intent.action.FACTORY_TEST" | |
String | ACTION_GET_CONTENT | Activity Action: Allow the user to select a particular kind of data and return it. | "android.intent.action.GET_CONTENT" | |
String | ACTION_GTALK_SERVICE_CONNECTED | Broadcast Action: An GTalk connection has been established. | "android.intent.action.GTALK_CONNECTED" | |
String | ACTION_GTALK_SERVICE_DISCONNECTED | Broadcast Action: An GTalk connection has been disconnected. | "android.intent.action.GTALK_DISCONNECTED" | |
String | ACTION_HEADSET_PLUG | Broadcast Action: Wired Headset plugged in or unplugged. | "android.intent.action.HEADSET_PLUG" | |
String | ACTION_INSERT | Activity Action: Insert an empty item into the given container. | "android.intent.action.INSERT" | |
String | ACTION_INSERT_OR_EDIT | Activity Action: Pick an existing item, or insert a new item, and then edit it. | "android.intent.action.INSERT_OR_EDIT" | |
String | ACTION_MAIN | Activity Action: Start as a main entry point, does not expect to receive data. | "android.intent.action.MAIN" | |
String | ACTION_MANAGE_PACKAGE_STORAGE | Broadcast Action: Indicates low memory condition notification acknowledged by user and package management should be started. | "android.intent.action.MANAGE_PACKAGE_STORAGE" | |
String | ACTION_MEDIA_BAD_REMOVAL | Broadcast Action: External media was removed from SD card slot, but mount point was not unmounted. | "android.intent.action.MEDIA_BAD_REMOVAL" | |
String | ACTION_MEDIA_BUTTON | Broadcast Action: The "Media Button" was pressed. | "android.intent.action.MEDIA_BUTTON" | |
String | ACTION_MEDIA_EJECT | Broadcast Action: User has expressed the desire to remove the external storage media. | "android.intent.action.MEDIA_EJECT" | |
String | ACTION_MEDIA_MOUNTED | Broadcast Action: External media is present and mounted at its mount point. | "android.intent.action.MEDIA_MOUNTED" | |
String | ACTION_MEDIA_REMOVED | Broadcast Action: External media has been removed. | "android.intent.action.MEDIA_REMOVED" | |
String | ACTION_MEDIA_SCANNER_FINISHED | Broadcast Action: The media scanner has finished scanning a directory. | "android.intent.action.MEDIA_SCANNER_FINISHED" | |
String | ACTION_MEDIA_SCANNER_SCAN_FILE | Broadcast Action: Request the media scanner to scan a file and add it to the media database. | "android.intent.action.MEDIA_SCANNER_SCAN_FILE" | |
String | ACTION_MEDIA_SCANNER_STARTED | Broadcast Action: The media scanner has started scanning a directory. | "android.intent.action.MEDIA_SCANNER_STARTED" | |
String | ACTION_MEDIA_SHARED | Broadcast Action: External media is unmounted because it is being shared via USB mass storage. | "android.intent.action.MEDIA_SHARED" | |
String | ACTION_MEDIA_UNMOUNTABLE | Broadcast Action: External media is present but cannot be mounted. | "android.intent.action.MEDIA_UNMOUNTABLE" | |
String | ACTION_MEDIA_UNMOUNTED | Broadcast Action: External media is present, but not mounted at its mount point. | "android.intent.action.MEDIA_UNMOUNTED" | |
String | ACTION_NEW_OUTGOING_CALL | Broadcast Action: An outgoing call is about to be placed. | "android.intent.action.NEW_OUTGOING_CALL" | |
String | ACTION_PACKAGE_ADDED | Broadcast Action: A new application package has been installed on the device. | "android.intent.action.PACKAGE_ADDED" | |
String | ACTION_PACKAGE_CHANGED | Broadcast Action: An existing application package has been changed (e.g. | "android.intent.action.PACKAGE_CHANGED" | |
String | ACTION_PACKAGE_INSTALL | Broadcast Action: Trigger the download and eventual installation of a package. | "android.intent.action.PACKAGE_INSTALL" | |
String | ACTION_PACKAGE_REMOVED | Broadcast Action: An existing application package has been removed from the device. | "android.intent.action.PACKAGE_REMOVED" | |
String | ACTION_PACKAGE_RESTARTED | Broadcast Action: The user has restarted a package, all runtime state associated with it (processes, alarms, notifications, etc) should be remove. | "android.intent.action.PACKAGE_RESTARTED" | |
String | ACTION_PICK | Activity Action: Pick an item from the data, returning what was selected. | "android.intent.action.PICK" | |
String | ACTION_PICK_ACTIVITY | Activity Action: Pick an activity given an intent, returning the class selected. | "android.intent.action.PICK_ACTIVITY" | |
String | ACTION_PROVIDER_CHANGED | Broadcast Action: Some content providers have parts of their namespace where they publish new events or items that the user may be especially interested in. | "android.intent.action.PROVIDER_CHANGED" | |
String | ACTION_RUN | Activity Action: Run the data, whatever that means. | "android.intent.action.RUN" | |
String | ACTION_SCREEN_OFF | Broadcast Action: Sent after the screen turns off. | "android.intent.action.SCREEN_OFF" | |
String | ACTION_SCREEN_ON | Broadcast Action: Sent after the screen turns on. | "android.intent.action.SCREEN_ON" | |
String | ACTION_SEARCH | Activity Action: Perform a search. | "android.intent.action.SEARCH" | |
String | ACTION_SEND | Activity Action: Deliver some data to someone else. | "android.intent.action.SEND" | |
String | ACTION_SENDTO | Activity Action: Send a message to someone specified by the data. | "android.intent.action.SENDTO" | |
String | ACTION_SET_WALLPAPER | Activity Action: Show settings for choosing wallpaper
Input: Nothing. |
"android.intent.action.SET_WALLPAPER" | |
String | ACTION_SYNC | Activity Action: Perform a data synchronization. | "android.intent.action.SYNC" | |
String | ACTION_TIMEZONE_CHANGED | Broadcast Action: The timezone has changed. | "android.intent.action.TIMEZONE_CHANGED" | |
String | ACTION_TIME_CHANGED | Broadcast Action: The time was set. | "android.intent.action.TIME_SET" | |
String | ACTION_TIME_TICK | Broadcast Action: The current time has changed. | "android.intent.action.TIME_TICK" | |
String | ACTION_UID_REMOVED | Broadcast Action: A user ID has been removed from the system. | "android.intent.action.UID_REMOVED" | |
String | ACTION_UMS_CONNECTED | Broadcast Action: The device has entered USB Mass Storage mode. | "android.intent.action.UMS_CONNECTED" | |
String | ACTION_UMS_DISCONNECTED | Broadcast Action: The device has exited USB Mass Storage mode. | "android.intent.action.UMS_DISCONNECTED" | |
String | ACTION_VIEW | Activity Action: Display the data to the user. | "android.intent.action.VIEW" | |
String | ACTION_VOICE_COMMAND | Activity Action: Start Voice Command. | "android.intent.action.VOICE_COMMAND" | |
String | ACTION_WALLPAPER_CHANGED | Broadcast Action: The current system wallpaper has changed. | "android.intent.action.WALLPAPER_CHANGED" | |
String | ACTION_WEB_SEARCH | Activity Action: Perform a web search. | "android.intent.action.WEB_SEARCH" | |
String | CATEGORY_ALTERNATIVE | Set if the activity should be considered as an alternative action to the data the user is currently viewing. | "android.intent.category.ALTERNATIVE" | |
String | CATEGORY_BROWSABLE | Activities that can be safely invoked from a browser must support this category. | "android.intent.category.BROWSABLE" | |
String | CATEGORY_DEFAULT | Set if the activity should be an option for the default action (center press) to perform on a piece of data. | "android.intent.category.DEFAULT" | |
String | CATEGORY_DEVELOPMENT_PREFERENCE | This activity is a development preference panel. | "android.intent.category.DEVELOPMENT_PREFERENCE" | |
String | CATEGORY_EMBED | Capable of running inside a parent activity container. | "android.intent.category.EMBED" | |
String | CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST | To be used as code under test for framework instrumentation tests. | "android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" | |
String | CATEGORY_GADGET | This activity can be embedded inside of another activity that is hosting gadgets. | "android.intent.category.GADGET" | |
String | CATEGORY_HOME | This is the home activity, that is the first activity that is displayed when the device boots. | "android.intent.category.HOME" | |
String | CATEGORY_LAUNCHER | Should be displayed in the top-level launcher. | "android.intent.category.LAUNCHER" | |
String | CATEGORY_MONKEY | This activity may be exercised by the monkey or other automated test tools. | "android.intent.category.MONKEY" | |
String | CATEGORY_OPENABLE | Used to indicate that a GET_CONTENT intent only wants URIs that can be opened with ContentResolver.openInputStream. | "android.intent.category.OPENABLE" | |
String | CATEGORY_PREFERENCE | This activity is a preference panel. | "android.intent.category.PREFERENCE" | |
String | CATEGORY_SAMPLE_CODE | To be used as an sample code example (not part of the normal user experience). | "android.intent.category.SAMPLE_CODE" | |
String | CATEGORY_SELECTED_ALTERNATIVE | Set if the activity should be considered as an alternative selection action to the data the user has currently selected. | "android.intent.category.SELECTED_ALTERNATIVE" | |
String | CATEGORY_TAB | Intended to be used as a tab inside of an containing TabActivity. | "android.intent.category.TAB" | |
String | CATEGORY_TEST | To be used as a test (not part of the normal user experience). | "android.intent.category.TEST" | |
String | CATEGORY_UNIT_TEST | To be used as a unit test (run through the Test Harness). | "android.intent.category.UNIT_TEST" | |
Creator<Intent> | CREATOR | |||
String | EXTRA_ALARM_COUNT | Used as an int extra field in AlarmManager intents to tell the application being invoked how many pending alarms are being delievered with the intent. | "android.intent.extra.ALARM_COUNT" | |
String | EXTRA_BCC | A String[] holding e-mail addresses that should be blind carbon copied. | "android.intent.extra.BCC" | |
String | EXTRA_CC | A String[] holding e-mail addresses that should be carbon copied. | "android.intent.extra.CC" | |
String | EXTRA_DONT_KILL_APP | Used as an boolean extra field in ACTION_PACKAGE_REMOVED or ACTION_PACKAGE_CHANGED intents to override the default action of restarting the application. | "android.intent.extra.DONT_KILL_APP" | |
String | EXTRA_EMAIL | A String[] holding e-mail addresses that should be delivered to. | "android.intent.extra.EMAIL" | |
String | EXTRA_INTENT | An Intent describing the choices you would like shown with ACTION_PICK_ACTIVITY. | "android.intent.extra.INTENT" | |
String | EXTRA_KEY_EVENT | A KeyEvent object containing the event that triggered the creation of the Intent it is in. | "android.intent.extra.KEY_EVENT" | |
String | EXTRA_PHONE_NUMBER | A String holding the phone number originally entered in ACTION_NEW_OUTGOING_CALL, or the actual number to call in a ACTION_CALL. | "android.intent.extra.PHONE_NUMBER" | |
String | EXTRA_SHORTCUT_ICON | The name of the extra used to define the icon, as a Bitmap, of a shortcut. | "android.intent.extra.shortcut.ICON" | |
String | EXTRA_SHORTCUT_ICON_RESOURCE | The name of the extra used to define the icon, as a ShortcutIconResource, of a shortcut. | "android.intent.extra.shortcut.ICON_RESOURCE" | |
String | EXTRA_SHORTCUT_INTENT | The name of the extra used to define the Intent of a shortcut. | "android.intent.extra.shortcut.INTENT" | |
String | EXTRA_SHORTCUT_NAME | The name of the extra used to define the name of a shortcut. | "android.intent.extra.shortcut.NAME" | |
String | EXTRA_STREAM | A content: URI holding a stream of data associated with the Intent, used with ACTION_SEND to supply the data being sent. | "android.intent.extra.STREAM" | |
String | EXTRA_SUBJECT | A constant string holding the desired subject line of a message. | "android.intent.extra.SUBJECT" | |
String | EXTRA_TEMPLATE | The initial data to place in a newly created record. | "android.intent.extra.TEMPLATE" | |
String | EXTRA_TEXT | A constant CharSequence that is associated with the Intent, used with ACTION_SEND to supply the literal data to be sent. | "android.intent.extra.TEXT" | |
String | EXTRA_TITLE | A CharSequence dialog title to provide to the user when used with a ACTION_CHOOSER. | "android.intent.extra.TITLE" | |
String | EXTRA_UID | Used as an int extra field in ACTION_UID_REMOVED intents to supply the uid the package had been assigned. | "android.intent.extra.UID" | |
int | FILL_IN_ACTION | Use with fillIn(Intent, int) to allow the current action value to be overwritten, even if it is already set. | 1 | 0x00000001 |
int | FILL_IN_CATEGORIES | Use with fillIn(Intent, int) to allow the current categories to be overwritten, even if they are already set. | 4 | 0x00000004 |
int | FILL_IN_COMPONENT | Use with fillIn(Intent, int) to allow the current component value to be overwritten, even if it is already set. | 8 | 0x00000008 |
int | FILL_IN_DATA | Use with fillIn(Intent, int) to allow the current data or type value overwritten, even if it is already set. | 2 | 0x00000002 |
int | FLAG_ACTIVITY_BROUGHT_TO_FRONT | This flag is not normally set by application code, but set for you by the system as described in the launchMode documentation for the singleTask mode. | 4194304 | 0x00400000 |
int | FLAG_ACTIVITY_CLEAR_TOP | If set, and the activity being launched is already running in the current task, then instead of launching a new instance of that activity, all of the other activities on top of it will be closed and this Intent will be delivered to the (now on top) old activity as a new Intent. | 67108864 | 0x04000000 |
int | FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS | If set, the new activity is not kept in the list of recently launched activities. | 8388608 | 0x00800000 |
int | FLAG_ACTIVITY_FORWARD_RESULT | If set and this intent is being used to launch a new activity from an existing one, then the reply target of the existing activity will be transfered to the new activity. | 33554432 | 0x02000000 |
int | FLAG_ACTIVITY_MULTIPLE_TASK | Used in conjunction with FLAG_ACTIVITY_NEW_TASK to disable the behavior of bringing an existing task to the foreground. | 134217728 | 0x08000000 |
int | FLAG_ACTIVITY_NEW_TASK | If set, this activity will become the start of a new task on this history stack. | 268435456 | 0x10000000 |
int | FLAG_ACTIVITY_NO_HISTORY | If set, the new activity is not kept in the history stack. | 1073741824 | 0x40000000 |
int | FLAG_ACTIVITY_PREVIOUS_IS_TOP | If set and this intent is being used to launch a new activity from an existing one, the current activity will not be counted as the top activity for deciding whether the new intent should be delivered to the top instead of starting a new one. | 16777216 | 0x01000000 |
int | FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | If set, and this activity is either being started in a new task or bringing to the top an existing task, then it will be launched as the front door of the task. | 2097152 | 0x00200000 |
int | FLAG_ACTIVITY_SINGLE_TOP | If set, the activity will not be launched if it is already running at the top of the history stack. | 536870912 | 0x20000000 |
int | FLAG_DEBUG_LOG_RESOLUTION | A flag you can enable for debugging: when set, log messages will be printed during the resolution of this intent to show you what has been found to create the final resolved list. | 8 | 0x00000008 |
int | FLAG_FROM_BACKGROUND | Can be set by the caller to indicate that this Intent is coming from a background operation, not from direct user interaction. | 4 | 0x00000004 |
int | FLAG_GRANT_READ_URI_PERMISSION | If set, the recipient of this Intent will be granted permission to perform read operations on the Uri in the Intent's data. | 1 | 0x00000001 |
int | FLAG_GRANT_WRITE_URI_PERMISSION | If set, the recipient of this Intent will be granted permission to perform write operations on the Uri in the Intent's data. | 2 | 0x00000002 |
int | FLAG_RECEIVER_REGISTERED_ONLY | If set, when sending a broadcast only registered receivers will be called -- no BroadcastReceiver components will be launched. | 1073741824 | 0x40000000 |
Intent() | ||||||
Create an empty intent. | ||||||
Intent(Intent o) | ||||||
Copy constructor. | ||||||
Intent(String action) | ||||||
Create an intent with a given action. | ||||||
Intent(String action, Uri uri) | ||||||
Create an intent with a given action and for a given data url. | ||||||
Intent(Context packageContext, Class<?> cls) | ||||||
Create an intent for a specific component. | ||||||
Intent(String action, Uri uri, Context packageContext, Class<?> cls) | ||||||
Create an intent for a specific component with a specified action and data. |
Intent | addCategory(String category) | |||||
Add a new category to the intent. | ||||||
Intent | addFlags(int flags) | |||||
Add additional flags to the intent (or with existing flags value). | ||||||
Object | clone() | |||||
Returns a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver. | ||||||
Intent | cloneFilter() | |||||
Make a clone of only the parts of the Intent that are relevant for filter matching: the action, data, type, component, and categories. | ||||||
static | Intent | createChooser(Intent target, CharSequence title) | ||||
Convenience function for creating a ACTION_CHOOSER Intent. | ||||||
int | describeContents() | |||||
Describe the kinds of special objects contained in this Parcelable's marshalled representation. | ||||||
int | fillIn(Intent other, int flags) | |||||
Copy the contents of other in to this object, but only where fields are not defined by this object. | ||||||
boolean | filterEquals(Intent other) | |||||
Determine if two intents are the same for the purposes of intent resolution (filtering). | ||||||
int | filterHashCode() | |||||
Generate hash code that matches semantics of filterEquals(). | ||||||
String | getAction() | |||||
Retrieve the general action to be performed, such as ACTION_VIEW. | ||||||
boolean[] | getBooleanArrayExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
boolean | getBooleanExtra(String name, boolean defaultValue) | |||||
Retrieve extended data from the intent. | ||||||
Bundle | getBundleExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
byte[] | getByteArrayExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
byte | getByteExtra(String name, byte defaultValue) | |||||
Retrieve extended data from the intent. | ||||||
Set<String> | getCategories() | |||||
Return the set of all categories in the intent. | ||||||
char[] | getCharArrayExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
char | getCharExtra(String name, char defaultValue) | |||||
Retrieve extended data from the intent. | ||||||
CharSequence | getCharSequenceExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
ComponentName | getComponent() | |||||
Retrieve the concrete component associated with the intent. | ||||||
Uri | getData() | |||||
Retrieve data this intent is operating on. | ||||||
String | getDataString() | |||||
The same as getData(), but returns the URI as an encoded String. | ||||||
double[] | getDoubleArrayExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
double | getDoubleExtra(String name, double defaultValue) | |||||
Retrieve extended data from the intent. | ||||||
Object | getExtra(String name, Object defaultValue) | |||||
Retrieve extended data from the intent. | ||||||
Object | getExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
Bundle | getExtras() | |||||
Retrieves a map of extended data from the intent. | ||||||
int | getFlags() | |||||
Retrieve any special flags associated with this intent. | ||||||
float[] | getFloatArrayExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
float | getFloatExtra(String name, float defaultValue) | |||||
Retrieve extended data from the intent. | ||||||
IBinder | getIBinderExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
int[] | getIntArrayExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
int | getIntExtra(String name, int defaultValue) | |||||
Retrieve extended data from the intent. | ||||||
ArrayList<Integer> | getIntegerArrayListExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
static | Intent | getIntent(String uri) | ||||
Create an intent from a URI. | ||||||
static | Intent | getIntentOld(String uri) | ||||
long[] | getLongArrayExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
long | getLongExtra(String name, long defaultValue) | |||||
Retrieve extended data from the intent. | ||||||
Parcelable[] | getParcelableArrayExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
<T extends Parcelable> | ArrayList<T> | getParcelableArrayListExtra(String name) | ||||
Retrieve extended data from the intent. | ||||||
<T extends Parcelable> | T | getParcelableExtra(String name) | ||||
Retrieve extended data from the intent. | ||||||
String | getScheme() | |||||
Return the scheme portion of the intent's data. | ||||||
Serializable | getSerializableExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
short[] | getShortArrayExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
short | getShortExtra(String name, short defaultValue) | |||||
Retrieve extended data from the intent. | ||||||
String[] | getStringArrayExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
ArrayList<String> | getStringArrayListExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
String | getStringExtra(String name) | |||||
Retrieve extended data from the intent. | ||||||
String | getType() | |||||
Retrieve any explicit MIME type included in the intent. | ||||||
boolean | hasCategory(String category) | |||||
Check if an category exists in the intent. | ||||||
boolean | hasExtra(String name) | |||||
Returns true if an extra value is associated with the given name. | ||||||
boolean | hasFileDescriptors() | |||||
Returns true if the Intent's extras contain a parcelled file descriptor. | ||||||
static | Intent | parseIntent(Resources resources, XmlPullParser parser, AttributeSet attrs) | ||||
Parses the "intent" element (and its children) from XML and instantiates an Intent object. | ||||||
Intent | putExtra(String name, String[] value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, Parcelable value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, long value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, boolean value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, double value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, IBinder value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, Parcelable[] value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, char value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, int[] value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, int value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, double[] value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, float value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, short value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, long[] value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, boolean[] value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, short[] value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, String value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, Serializable value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, float[] value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, Bundle value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, byte[] value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, CharSequence value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, char[] value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtra(String name, byte value) | |||||
Add extended data to the intent. | ||||||
Intent | putExtras(Intent src) | |||||
Copy all extras in 'src' in to this intent. | ||||||
Intent | putExtras(Bundle extras) | |||||
Add a set of extended data to the intent. | ||||||
Intent | putIntegerArrayListExtra(String name, ArrayList<Integer> value) | |||||
Add extended data to the intent. | ||||||
Intent | putParcelableArrayListExtra(String name, ArrayList<? extends Parcelable> value) | |||||
Add extended data to the intent. | ||||||
Intent | putStringArrayListExtra(String name, ArrayList<String> value) | |||||
Add extended data to the intent. | ||||||
void | readFromParcel(Parcel in) | |||||
void | removeCategory(String category) | |||||
Remove an category from an intent. | ||||||
void | removeExtra(String name) | |||||
Remove extended data from the intent. | ||||||
ComponentName | resolveActivity(PackageManager pm) | |||||
Return the Activity component that should be used to handle this intent. | ||||||
ActivityInfo | resolveActivityInfo(PackageManager pm, int flags) | |||||
Resolve the Intent into an ActivityInfo describing the activity that should execute the intent. | ||||||
String | resolveType(ContentResolver resolver) | |||||
Return the MIME data type of this intent. | ||||||
String | resolveType(Context context) | |||||
Return the MIME data type of this intent. | ||||||
String | resolveTypeIfNeeded(ContentResolver resolver) | |||||
Return the MIME data type of this intent, only if it will be needed for intent resolution. | ||||||
Intent | setAction(String action) | |||||
Set the general action to be performed. | ||||||
Intent | setClass(Context packageContext, Class<?> cls) | |||||
Convenience for calling setComponent(ComponentName) with the name returned by a Class object. | ||||||
Intent | setClassName(String packageName, String className) | |||||
Convenience for calling setComponent(ComponentName) with an explicit application package name and class name. | ||||||
Intent | setClassName(Context packageContext, String className) | |||||
Convenience for calling setComponent(ComponentName) with an explicit class name. | ||||||
Intent | setComponent(ComponentName component) | |||||
(Usually optional) Explicitly set the component to handle the intent. | ||||||
Intent | setData(Uri data) | |||||
Set the data this intent is operating on. | ||||||
Intent | setDataAndType(Uri data, String type) | |||||
(Usually optional) Set the data for the intent along with an explicit MIME data type. | ||||||
void | setExtrasClassLoader(ClassLoader loader) | |||||
Sets the ClassLoader that will be used when unmarshalling any Parcelable values from the extras of this Intent. | ||||||
Intent | setFlags(int flags) | |||||
Set special flags controlling how this intent is handled. | ||||||
Intent | setType(String type) | |||||
Set an explicit MIME data type. | ||||||
String | toString() | |||||
Returns a string containing a concise, human-readable description of the receiver. | ||||||
String | toURI() | |||||
void | writeToParcel(Parcel out, int flags) | |||||
Flatten this object in to a Parcel. |
Broadcast Action: The user has switched the phone into or out of Airplane Mode. One or more radios have been turned off or on. The intent will have the following extra value:
Input: Nothing.
Output: nothing.
Input: nothing.
Output: nothing.
Input: getData() is URI of data to be attached.
Output: nothing.
You can not receive this through components declared in manifests, only by exlicitly registering for it with Context.registerReceiver().
Input: Nothing.
Output: Nothing.
Input: If nothing, an empty dialer is started; else getData() is URI of a phone number to be dialed or a tel: URI of an explicit phone number.
Output: nothing.
Note: there will be restrictions on which applications can initiate a call; most applications should use the ACTION_DIAL.
Note: this Intent cannot be used to call emergency numbers. Applications can dial emergency numbers using ACTION_DIAL, however.
This action should be used when the user will naturally expect to select an activity in order to proceed. An example if when not to use it is when the user clicks on a "mailto:" link. They would naturally expect to go directly to their mail app, so startActivity() should be called directly: it will either launch the current preferred app, or put up a dialog allowing the user to pick an app to use and optionally marking that as preferred.
In contrast, if the user is selecting a menu item to send a picture they are viewing to someone else, there are many different things they may want to do at this point: send it through e-mail, upload it to a web service, etc. In this case the CHOOSER action should be used, to always present to the user a list of the things they can do, with a nice title given by the caller such as "Send this photo with:".
As a convenience, an Intent of this form can be created with the createChooser(Intent, CharSequence) function.
Input: No data should be specified. getExtra(String) must have a EXTRA_INTENT field containing the Intent being executed, and can optionally have a EXTRA_TITLE field containing the title text to display in the chooser.
Output: Depends on the protocol of EXTRA_INTENT.
Input: Nothing.
Output: An Intent representing the shortcut. The intent must contain three extras: SHORTCUT_INTENT (value: Intent), SHORTCUT_NAME (value: String), and SHORTCUT_ICON (value: Bitmap) or SHORTCUT_ICON_RESOURCE (value: ShortcutIconResource).
Input: getData() is URI of data to be deleted.
Output: nothing.
Input: If nothing, an empty dialer is started; else getData() is URI of a phone number to be dialed or a tel: URI of an explicit phone number.
Output: nothing.
Input: getData() is URI of data to be edited.
Output: nothing.
Input: nothing
Output: nothing
There are two main ways to use this action: if you want an specific kind of data, such as a person contact, you set the MIME type to the kind of data you want and launch it with startActivity(Intent). The system will then launch the best application to select that kind of data for you.
You may also be interested in any of a set of types of content the user can pick. For example, an e-mail application that wants to allow the user to add an attachment to an e-mail message can use this action to bring up a list of all of the types of content the user can attach.
In this case, you should wrap the GET_CONTENT intent with a chooser (through createChooser(Intent, CharSequence)), which will give the proper interface for the user to pick how to send your data and allow you to specify a prompt indicating what they are doing. You will usually specify a broad MIME type (such as image/* or */*), resulting in a broad range of content types the user can select from.
When using such a broad GET_CONTENT action, it is often desireable to only pick from data that can be represented as a stream. This is accomplished by requiring the CATEGORY_OPENABLE in the Intent.
Input: getType() is the desired MIME type to retrieve. Note that no URI is supplied in the intent, as there are no constraints on where the returned data originally comes from. You may also include the CATEGORY_OPENABLE if you can only accept data that can be opened as a stream.
Output: The URI of the item that was picked. This must be a content: URI so that any receiver can access it.
The intent will have the following extra values:
Input: getData() is URI of the directory (vnd.android.cursor.dir/*) in which to place the data.
Output: URI of the new data that was created.
Input: getType() is the desired MIME type of the item to create or edit. The extras can contain type specific data to pass through to the editing/creating activity.
Output: The URI of the item that was picked. This must be a content: URI so that any receiver can access it.
Input: nothing
Output: nothing
The Intent will have the following extra value:
Once the broadcast is finished, the resultData is used as the actual
number to call. If null
, no call will be placed.
It is perfectly acceptable for multiple receivers to process the outgoing call in turn: for example, a parental control application might verify that the user is authorized to place the call at that time, then a number-rewriting application might add an area code if one was not specified.
For consistency, any receiver whose purpose is to prohibit phone calls should have a priority of 0, to ensure it will see the final phone number to be dialed. Any receiver whose purpose is to rewrite phone numbers to be called should have a positive priority. Negative priorities are reserved for the system for this broadcast; using them may cause problems.
Any BroadcastReceiver receiving this Intent must not abort the broadcast.
Emergency calls cannot be intercepted using this mechanism, and other calls cannot be modified to call emergency numbers using this mechanism.
You must hold the PROCESS_OUTGOING_CALLS permission to receive this Intent.
Input: getData() is the URI of the package file to download.
Input: getData() is URI containing a directory of data (vnd.android.cursor.dir/*) from which to pick an item.
Output: The URI of the item that was picked.
Input: getExtra(String) field EXTRA_INTENT is an Intent used with queryIntentActivities(Intent, int) to determine the set of activities from which to pick.
Output: Class name of the activity that was selected.
The data of the intent identifies which part of which provider changed. When queried through the content resolver, the data URI will return the data set in question.
The intent will have the following extra values:
Input: ? (Note: this is currently specific to the test harness.)
Output: nothing.
Input: getStringExtra(SearchManager.QUERY) is the text to search for. If empty, simply enter your search results Activity with the search UI activated.
Output: nothing.
When launching a SEND intent, you should usually wrap it in a chooser (through createChooser(Intent, CharSequence)), which will give the proper interface for the user to pick how to send your data and allow you to specify a prompt indicating what they are doing.
Input: getType() is the MIME type of the data being sent. getExtra(String) can have either a EXTRA_TEXT or EXTRA_STREAM field, containing the data to be sent. If using EXTRA_TEXT, the MIME type should be "text/plain"; otherwise it should be the MIME type of the data in EXTRA_STREAM. Use */* if the MIME type is unknown (this will only allow senders that can handle generic data streams).
Optional standard extras, which may be interpreted by some recipients as appropriate, are: EXTRA_EMAIL, EXTRA_CC, EXTRA_BCC, EXTRA_SUBJECT.
Output: nothing.
Input: getData() is URI describing the target.
Output: nothing.
Input: Nothing.
Output: Nothing.
Input: ?
Output: ?
Input: getData() is URI from which to retrieve data.
Output: nothing.
Input: Nothing.
Output: Nothing.
Input: getData() is URI of data. If it is a url starts with http or https, the site will be opened. If it is plain text, Google search will be applied.
Output: nothing.
Supporting this category means that you would like your activity to be displayed in the set of alternative things the user can do, usually as part of the current activity's options menu. You will usually want to include a specific label in the <intent-filter> of this action describing to the user what it does.
The action of IntentFilter with this category is important in that it describes the specific action the target will perform. This generally should not be a generic action (such as ACTION_VIEW, but rather a specific name such as "com.android.camera.action.CROP. Only one alternative of any particular action will be shown to the user, so using a specific action like this makes sure that your alternative will be displayed while also allowing other applications to provide their own overrides of that particular action.
Note: being removed in favor of more explicit categories such as CATEGORY_GADGET
For example, consider a task consisting of the activities: A, B, C, D. If D calls startActivity() with an Intent that resolves to the component of activity B, then C and D will be finished and B receive the given Intent, resulting in the stack now being: A, B.
The currently running instance of task B in the above example will either receiving the new intent you are starting here in its onNewIntent() method, or be itself finished and restarting with the new intent. If it has declared its launch mode to be "multiple" (the default) it will be finished and re-created; for all other launch modes it will receive the Intent in the current instance.
This launch mode can also be used to good effect in conjunction with FLAG_ACTIVITY_NEW_TASK: if used to start the root activity of a task, it will bring any currently running instance of that task to the foreground, and then clear it to its root state. This is especially useful, for example, when launching an activity from the notification manager.
See the Application Model documentation for more details on tasks.
Because the default system does not include graphical task management, you should not use this flag unless you provide some way for a user to return back to the tasks you have launched. This flag is ignored if FLAG_ACTIVITY_NEW_TASK is not set.
See the Application Model documentation for more details on tasks.
This flag is generally used by activities that want to present a "launcher" style behavior: they give the user a list of separate things that can be done, which otherwise run completely independently of the activity launching them.
When using this flag, if a task is already running for the activity you are now starting, then a new activity will not be started; instead, the current task will simply be brought to the front of the screen with the state it was last in. See FLAG_ACTIVITY_MULTIPLE_TASK for a flag to disable this behavior.
This flag can not be used when the caller is requesting a result from the activity being launched.
action | The Intent action, such as ACTION_VIEW. |
---|
action | The Intent action, such as ACTION_VIEW. |
---|---|
uri | The Intent data URI. |
packageContext | A Context of the application package implementing this class. |
---|---|
cls | The component class that is to be used for the intent. |
action | The Intent action, such as ACTION_VIEW. |
---|---|
uri | The Intent data URI. |
packageContext | A Context of the application package implementing this class. |
cls | The component class that is to be used for the intent. |
category | The desired category. This can be either one of the predefined Intent categories, or a custom category in your own namespace. |
---|
flags | The new flags to set. |
---|
Classes which wish to support cloning must specify that they implement the Cloneable interface, since the implementation checks for this.
target | The Intent that the user will be selecting an activity to perform. |
---|---|
title | Optional title that will be displayed in the chooser. |
In addition, you can use the FILL_IN_ACTION, FILL_IN_DATA, FILL_IN_CATEGORIES, and FILL_IN_COMPONENT to override the restriction where the corresponding field will not be replaced if it is already set.
For example, consider Intent A with {data="foo", categories="bar"} and Intent B with {action="gotit", data-type="some/thing", categories="one","two"}.
Calling A.fillIn(B, Intent.FILL_IN_DATA) will result in A now containing: {action="gotit", data-type="some/thing", categories="bar"}.
other | Another Intent whose values are to be used to fill in the current one. |
---|---|
flags | Options to control which fields can be filled in. |
other | The other Intent to compare against. |
---|
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|---|
defaultValue | the value to be returned if no value of the desried type is stored with the given name. |
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|---|
defaultValue | the value to be returned if no value of the desried type is stored with the given name. |
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|---|
defaultValue | the value to be returned if no value of the desried type is stored with the given name. |
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|---|
defaultValue | the value to be returned if no value of the desried type is stored with the given name. |
name | The name of the desired item. |
---|---|
defaultValue | The default value to return in case no item is associated with the key 'name' |
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|---|
defaultValue | the value to be returned if no value of the desried type is stored with the given name. |
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|---|
defaultValue | the value to be returned if no value of the desried type is stored with the given name. |
name | The name of the desired item. |
---|
The URI given here must not be relative -- that is, it must include the scheme and full path.
uri | The URI to turn into an Intent. |
---|
URISyntaxException |
---|
URISyntaxException |
---|
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|---|
defaultValue | the value to be returned if no value of the desried type is stored with the given name. |
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|
This is the same as calling getData().getScheme() (and checking for null data).
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|---|
defaultValue | the value to be returned if no value of the desried type is stored with the given name. |
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|
name | The name of the desired item. |
---|
category | The category to check. |
---|
name | the extra's name |
---|
resources | The Resources to use when inflating resources. |
---|---|
parser | The XML parser pointing at an "intent" tag. |
attrs | The AttributeSet interface for retrieving extended attribute data at the current parser location. |
XmlPullParserException | If there was an XML parsing error. |
---|---|
IOException | If there was an I/O error. |
name | The name of the extra data, with package prefix. |
---|---|
value | The String array data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The Parcelable data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The long data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The boolean data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The double data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The IBinder data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The Parcelable[] data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The char data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The int array data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The integer data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The double array data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The float data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The short data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The byte array data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The boolean array data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The short array data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The String data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The Serializable data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The float array data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The Bundle data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The byte array data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The CharSequence data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The char array data value. |
name | The name of the extra data, with package prefix. |
---|---|
value | The byte data value. |
src | Contains the extras to copy. |
---|
extras | The Bundle of extras to add to this intent. |
---|
name | The name of the extra data, with package prefix. |
---|---|
value | The ArrayList |
name | The name of the extra data, with package prefix. |
---|---|
value | The ArrayList |
name | The name of the extra data, with package prefix. |
---|---|
value | The ArrayList |
category | The category to remove. |
---|
If getComponent() returns an explicit class, that is returned without any further consideration.
The activity must handle the CATEGORY_DEFAULT Intent category to be considered.
If getAction() is non-NULL, the activity must handle this action.
If resolveType(ContentResolver) returns non-NULL, the activity must handle this type.
If addCategory(String) has added any categories, the activity must handle ALL of the categories specified.
If there are no activities that satisfy all of these conditions, a null string is returned.
If multiple activities are found to satisfy the intent, the one with the highest priority will be used. If there are multiple activities with the same priority, the system will either pick the best activity based on user preference, or resolve to a system class that will allow the user to pick an activity and forward from there.
This method is implemented simply by calling resolveActivity(Intent, int) with the "defaultOnly" parameter true.
This API is called for you as part of starting an activity from an intent. You do not normally need to call it yourself.
pm | The package manager with which to resolve the Intent. |
---|
pm | The package manager with which to resolve the Intent. |
---|---|
flags | Addition information to retrieve as per PackageManager.getActivityInfo(). |
resolver | A ContentResolver that can be used to determine the MIME type of the intent's data. |
---|
resolver | A ContentResolver that can be used to determine the MIME type of the intent's data. |
---|
action | An action name, such as ACTION_VIEW. Application-specific actions should be prefixed with the vendor's package name. |
---|
packageContext | A Context of the application package implementing this class. |
---|---|
cls | The class name to set, equivalent to
setClassName(context, cls.getName()) . |
packageName | The name of the package implementing the desired component. |
---|---|
className | The name of a class inside of the application package that will be used as the component for this Intent. |
packageContext | A Context of the application package implementing this class. |
---|---|
className | The name of a class inside of the application package that will be used as the component for this Intent. |
component | The name of the application component to handle the intent, or null to let the system find one for you. |
---|
data | The URI of the data this intent is now targeting. |
---|
data | The URI of the data this intent is now targeting. |
---|---|
type | The MIME type of the data being handled by this intent. |
loader | a ClassLoader, or null to use the default loader at the time of unmarshalling. |
---|
See the Application Model documentation for important information on how some of these options impact the behavior of your application.
flags | The desired flags. |
---|
type | The MIME type of the data being handled by this intent. |
---|
Copyright 2007 Google Inc. | Build 0.9_r1-98467 - 14 Aug 2008 18:48 |