Build 1.0_r1(from source)

android.content
Class Intent

java.lang.Object
  extended by android.content.Intent
All Implemented Interfaces:
Parcelable

public class Intent
extends Object
implements 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 Context.startService(android.content.Intent) or Context.bindService(android.content.Intent, android.content.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:

Some examples of action/data pairs are:

In addition to these primary attributes, there are a number of secondary attributes that you can also include with an intent:

Here are some examples of other operations you can specify as intents using these additional parameters:

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.

Intent Resolution

There are two primary forms of intents you will use.

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 Context.registerReceiver(android.content.BroadcastReceiver, android.content.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:

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:

  1.  <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.

  2.  <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.

  3.  <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:

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:

  1.  <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.

  2.  <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:

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 PackageManager.queryIntentActivityOptions(android.content.ComponentName, android.content.Intent[], android.content.Intent, int) method, or more often to build dynamic menu items with Menu.addIntentOptions(int, int, int, android.content.ComponentName, android.content.Intent[], android.content.Intent, int, android.view.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:

Standard Activity Actions

These are the current standard actions that Intent defines for launching activities (usually through Context.startActivity(android.content.Intent). The most important, and by far most frequently used, are ACTION_MAIN and ACTION_EDIT.

Standard Broadcast Actions

These are the current standard actions that Intent defines for receiving broadcasts (usually through Context.registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter) or a <receiver> tag in a manifest).

Standard Categories

These are the current standard categories that can be used to further clarify an Intent via addCategory(java.lang.String).

Standard Extra Data

These are the current standard fields that can be used as extra data via putExtra(java.lang.String, boolean).

Flags

These are the possible flags that can be used in the Intent via setFlags(int) and addFlags(int).


Nested Class Summary
static class Intent.FilterComparison
          Wrapper class holding an Intent and implementing comparisons on it for the purpose of filtering.
static class Intent.ShortcutIconResource
          Represents a shortcut icon resource.
 
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.Creator<T>
 
Field Summary
static String ACTION_AIRPLANE_MODE_CHANGED
          Broadcast Action: The user has switched the phone into or out of Airplane Mode.
static String ACTION_ALARM_CHANGED
          Alarm Changed Action: This is broadcast when the AlarmClock application's alarm is set or unset.
static String ACTION_ALL_APPS
          Activity Action: List all available applications
static String ACTION_ANSWER
          Activity Action: Handle an incoming phone call.
static String ACTION_ATTACH_DATA
          Used to indicate that some piece of data should be attached to some other place.
static String ACTION_BATTERY_CHANGED
          Broadcast Action: The charging state, or charge level of the battery has changed.
static String ACTION_BATTERY_LOW
          Broadcast Action: Indicates low battery condition on the device.
static String ACTION_BOOT_COMPLETED
          Broadcast Action: This is broadcast once, after the system has finished booting.
static String ACTION_BUG_REPORT
          Activity Action: Show activity for reporting a bug.
static String ACTION_CALL
          Activity Action: Perform a call to someone specified by the data.
static String ACTION_CALL_BUTTON
          Activity Action: The user pressed the "call" button to go to the dialer or other appropriate UI for placing a call.
static String ACTION_CALL_EMERGENCY
          Activity Action: Perform a call to an emergency number specified by the data.
static String ACTION_CALL_PRIVILEGED
          Activity action: Perform a call to any number (emergency or not) specified by the data.
static String ACTION_CAMERA_BUTTON
          Broadcast Action: The "Camera Button" was pressed.
static String ACTION_CHOOSER
          Activity Action: Display an activity chooser, allowing the user to pick what they want to before proceeding.
static String ACTION_CLOSE_SYSTEM_DIALOGS
          Broadcast Action: This is broadcast when a user action should request a temporary system dialog to dismiss.
static String ACTION_CONFIGURATION_CHANGED
          Broadcast Action: The current device Configuration (orientation, locale, etc) has changed.
static String ACTION_CREATE_SHORTCUT
          Activity Action: Creates a shortcut.
static String ACTION_DATE_CHANGED
          Broadcast Action: The date has changed.
static String ACTION_DEFAULT
          A synonym for ACTION_VIEW, the "standard" action that is performed on a piece of data.
static String ACTION_DELETE
          Activity Action: Delete the given data from its container.
static String ACTION_DEVICE_STORAGE_LOW
          Broadcast Action: Indicates low memory condition on the device
static String ACTION_DEVICE_STORAGE_OK
          Broadcast Action: Indicates low memory condition on the device no longer exists
static String ACTION_DIAL
          Activity Action: Dial a number as specified by the data.
static String ACTION_EDIT
          Activity Action: Provide explicit editable access to the given data.
static String ACTION_FACTORY_TEST
          Activity Action: Main entry point for factory tests.
static String ACTION_GET_CONTENT
          Activity Action: Allow the user to select a particular kind of data and return it.
static String ACTION_GTALK_SERVICE_CONNECTED
          Broadcast Action: An GTalk connection has been established.
static String ACTION_GTALK_SERVICE_DISCONNECTED
          Broadcast Action: An GTalk connection has been disconnected.
static String ACTION_HEADSET_PLUG
          Broadcast Action: Wired Headset plugged in or unplugged.
static String ACTION_INSERT
          Activity Action: Insert an empty item into the given container.
static String ACTION_INSERT_OR_EDIT
          Activity Action: Pick an existing item, or insert a new item, and then edit it.
static String ACTION_MAIN
          Activity Action: Start as a main entry point, does not expect to receive data.
static String ACTION_MANAGE_PACKAGE_STORAGE
          Broadcast Action: Indicates low memory condition notification acknowledged by user and package management should be started.
static String ACTION_MEDIA_BAD_REMOVAL
          Broadcast Action: External media was removed from SD card slot, but mount point was not unmounted.
static String ACTION_MEDIA_BUTTON
          Broadcast Action: The "Media Button" was pressed.
static String ACTION_MEDIA_EJECT
          Broadcast Action: User has expressed the desire to remove the external storage media.
static String ACTION_MEDIA_MOUNTED
          Broadcast Action: External media is present and mounted at its mount point.
static String ACTION_MEDIA_REMOVED
          Broadcast Action: External media has been removed.
static String ACTION_MEDIA_SCANNER_FINISHED
          Broadcast Action: The media scanner has finished scanning a directory.
static String ACTION_MEDIA_SCANNER_SCAN_FILE
          Broadcast Action: Request the media scanner to scan a file and add it to the media database.
static String ACTION_MEDIA_SCANNER_STARTED
          Broadcast Action: The media scanner has started scanning a directory.
static String ACTION_MEDIA_SHARED
          Broadcast Action: External media is unmounted because it is being shared via USB mass storage.
static String ACTION_MEDIA_UNMOUNTABLE
          Broadcast Action: External media is present but cannot be mounted.
static String ACTION_MEDIA_UNMOUNTED
          Broadcast Action: External media is present, but not mounted at its mount point.
static String ACTION_NEW_OUTGOING_CALL
          Broadcast Action: An outgoing call is about to be placed.
static String ACTION_PACKAGE_ADDED
          Broadcast Action: A new application package has been installed on the device.
static String ACTION_PACKAGE_CHANGED
          Broadcast Action: An existing application package has been changed (e.g.
static String ACTION_PACKAGE_INSTALL
          Broadcast Action: Trigger the download and eventual installation of a package.
static String ACTION_PACKAGE_REMOVED
          Broadcast Action: An existing application package has been removed from the device.
static 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.
static String ACTION_PICK
          Activity Action: Pick an item from the data, returning what was selected.
static String ACTION_PICK_ACTIVITY
          Activity Action: Pick an activity given an intent, returning the class selected.
static String ACTION_POWER_CONNECTED
          Broadcast Action: External power has been connected to the device.
static String ACTION_POWER_DISCONNECTED
          Broadcast Action: External power has been removed from the device.
static 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.
static String ACTION_REBOOT
          Broadcast Action: Have the device reboot.
static String ACTION_RUN
          Activity Action: Run the data, whatever that means.
static String ACTION_SCREEN_OFF
          Broadcast Action: Sent after the screen turns off.
static String ACTION_SCREEN_ON
          Broadcast Action: Sent after the screen turns on.
static String ACTION_SEARCH
          Activity Action: Perform a search.
static String ACTION_SEND
          Activity Action: Deliver some data to someone else.
static String ACTION_SENDTO
          Activity Action: Send a message to someone specified by the data.
static String ACTION_SET_WALLPAPER
          Activity Action: Show settings for choosing wallpaper
static String ACTION_SYNC
          Activity Action: Perform a data synchronization.
static String ACTION_SYNC_STATE_CHANGED
          Sync State Changed Action: This is broadcast when the sync starts or stops or when one has been failing for a long time.
static String ACTION_TIME_CHANGED
          Broadcast Action: The time was set.
static String ACTION_TIME_TICK
          Broadcast Action: The current time has changed.
static String ACTION_TIMEZONE_CHANGED
          Broadcast Action: The timezone has changed.
static String ACTION_UID_REMOVED
          Broadcast Action: A user ID has been removed from the system.
static String ACTION_UMS_CONNECTED
          Broadcast Action: The device has entered USB Mass Storage mode.
static String ACTION_UMS_DISCONNECTED
          Broadcast Action: The device has exited USB Mass Storage mode.
static String ACTION_VIEW
          Activity Action: Display the data to the user.
static String ACTION_VOICE_COMMAND
          Activity Action: Start Voice Command.
static String ACTION_WALLPAPER_CHANGED
          Broadcast Action: The current system wallpaper has changed.
static String ACTION_WEB_SEARCH
          Activity Action: Perform a web search.
static String CATEGORY_ALTERNATIVE
          Set if the activity should be considered as an alternative action to the data the user is currently viewing.
static String CATEGORY_BROWSABLE
          Activities that can be safely invoked from a browser must support this category.
static String CATEGORY_DEFAULT
          Set if the activity should be an option for the default action (center press) to perform on a piece of data.
static String CATEGORY_DEVELOPMENT_PREFERENCE
          This activity is a development preference panel.
static String CATEGORY_EMBED
          Capable of running inside a parent activity container.
static String CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST
          To be used as code under test for framework instrumentation tests.
static String CATEGORY_GADGET
          This activity can be embedded inside of another activity that is hosting gadgets.
static String CATEGORY_HOME
          This is the home activity, that is the first activity that is displayed when the device boots.
static String CATEGORY_LAUNCHER
          Should be displayed in the top-level launcher.
static String CATEGORY_MONKEY
          This activity may be exercised by the monkey or other automated test tools.
static String CATEGORY_OPENABLE
          Used to indicate that a GET_CONTENT intent only wants URIs that can be opened with ContentResolver.openInputStream.
static String CATEGORY_PREFERENCE
          This activity is a preference panel.
static String CATEGORY_SAMPLE_CODE
          To be used as an sample code example (not part of the normal user experience).
static String CATEGORY_SELECTED_ALTERNATIVE
          Set if the activity should be considered as an alternative selection action to the data the user has currently selected.
static String CATEGORY_TAB
          Intended to be used as a tab inside of an containing TabActivity.
static String CATEGORY_TEST
          To be used as a test (not part of the normal user experience).
static String CATEGORY_UNIT_TEST
          To be used as a unit test (run through the Test Harness).
static Parcelable.Creator<Intent> CREATOR
           
static 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.
static String EXTRA_BCC
          A String[] holding e-mail addresses that should be blind carbon copied.
static String EXTRA_CC
          A String[] holding e-mail addresses that should be carbon copied.
static 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.
static String EXTRA_EMAIL
          A String[] holding e-mail addresses that should be delivered to.
static String EXTRA_INTENT
          An Intent describing the choices you would like shown with ACTION_PICK_ACTIVITY.
static String EXTRA_KEY_EVENT
          A KeyEvent object containing the event that triggered the creation of the Intent it is in.
static 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.
static String EXTRA_SHORTCUT_ICON
          The name of the extra used to define the icon, as a Bitmap, of a shortcut.
static String EXTRA_SHORTCUT_ICON_RESOURCE
          The name of the extra used to define the icon, as a ShortcutIconResource, of a shortcut.
static String EXTRA_SHORTCUT_INTENT
          The name of the extra used to define the Intent of a shortcut.
static String EXTRA_SHORTCUT_NAME
          The name of the extra used to define the name of a shortcut.
static 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.
static String EXTRA_SUBJECT
          A constant string holding the desired subject line of a message.
static String EXTRA_TEMPLATE
          The initial data to place in a newly created record.
static String EXTRA_TEXT
          A constant CharSequence that is associated with the Intent, used with ACTION_SEND to supply the literal data to be sent.
static String EXTRA_TITLE
          A CharSequence dialog title to provide to the user when used with a ACTION_CHOOSER.
static String EXTRA_UID
          Used as an int extra field in ACTION_UID_REMOVED intents to supply the uid the package had been assigned.
static int FILL_IN_ACTION
          Use with fillIn(android.content.Intent, int) to allow the current action value to be overwritten, even if it is already set.
static int FILL_IN_CATEGORIES
          Use with fillIn(android.content.Intent, int) to allow the current categories to be overwritten, even if they are already set.
static int FILL_IN_COMPONENT
          Use with fillIn(android.content.Intent, int) to allow the current component value to be overwritten, even if it is already set.
static int FILL_IN_DATA
          Use with fillIn(android.content.Intent, int) to allow the current data or type value overwritten, even if it is already set.
static 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.
static 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.
static int FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
          If set, the new activity is not kept in the list of recently launched activities.
static 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.
static int FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY
          If set, this activity is being launched from history (longpress home key).
static int FLAG_ACTIVITY_MULTIPLE_TASK
          Do not use this flag unless you are implementing your own top-level application launcher. Used in conjunction with FLAG_ACTIVITY_NEW_TASK to disable the behavior of bringing an existing task to the foreground.
static int FLAG_ACTIVITY_NEW_TASK
          If set, this activity will become the start of a new task on this history stack.
static int FLAG_ACTIVITY_NO_HISTORY
          If set, the new activity is not kept in the history stack.
static 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.
static 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.
static 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.
static 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.
static 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.
static 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.
static 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.
static int FLAG_RECEIVER_REGISTERED_ONLY
          If set, when sending a broadcast only registered receivers will be called -- no BroadcastReceiver components will be launched.
 
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
 
Constructor Summary
Intent()
          Create an empty intent.
Intent(Context packageContext, Class<?> cls)
          Create an intent for a specific component.
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(String action, Uri uri, Context packageContext, Class<?> cls)
          Create an intent for a specific component with a specified action and data.
 
Method Summary
 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)
          Deprecated.  
 Object getExtra(String name, Object defaultValue)
          Deprecated.  
 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)
          Deprecated.  
 int[] getIntArrayExtra(String name)
          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)
           
 int getIntExtra(String name, int defaultValue)
          Retrieve extended data from the intent.
 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, boolean value)
          Add extended data to the intent.
 Intent putExtra(String name, boolean[] 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, byte[] value)
          Add extended data to the intent.
 Intent putExtra(String name, char value)
          Add extended data to the intent.
 Intent putExtra(String name, char[] value)
          Add extended data to the intent.
 Intent putExtra(String name, CharSequence value)
          Add extended data to the intent.
 Intent putExtra(String name, double 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, float[] value)
          Add extended data to the intent.
 Intent putExtra(String name, IBinder value)
          Deprecated.  
 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, long value)
          Add extended data to the intent.
 Intent putExtra(String name, long[] value)
          Add extended data to the intent.
 Intent putExtra(String name, Parcelable value)
          Add extended data to the intent.
 Intent putExtra(String name, Parcelable[] value)
          Add extended data to the intent.
 Intent putExtra(String name, Serializable value)
          Add extended data to the intent.
 Intent putExtra(String name, short 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, String[] value)
          Add extended data to the intent.
 Intent putExtras(Bundle extras)
          Add a set of extended data to the intent.
 Intent putExtras(Intent src)
          Copy all extras in 'src' in to this 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(Context packageContext, String className)
          Convenience for calling setComponent(android.content.ComponentName) with an explicit class name.
 Intent setClassName(String packageName, String className)
          Convenience for calling setComponent(android.content.ComponentName) with an explicit application package name and 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.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACTION_MAIN

public static final String ACTION_MAIN
Activity Action: Start as a main entry point, does not expect to receive data.

Input: nothing

Output: nothing

See Also:
Constant Field Values

ACTION_VIEW

public static final String ACTION_VIEW
Activity Action: Display the data to the user. This is the most common action performed on data -- it is the generic action you can use on a piece of data to get the most reasonable thing to occur. For example, when used on a contacts entry it will view the entry; when used on a mailto: URI it will bring up a compose window filled with the information supplied by the URI; when used with a tel: URI it will invoke the dialer.

Input: getData() is URI from which to retrieve data.

Output: nothing.

See Also:
Constant Field Values

ACTION_DEFAULT

public static final String ACTION_DEFAULT
A synonym for ACTION_VIEW, the "standard" action that is performed on a piece of data.

See Also:
Constant Field Values

ACTION_ATTACH_DATA

public static final String ACTION_ATTACH_DATA
Used to indicate that some piece of data should be attached to some other place. For example, image data could be attached to a contact. It is up to the recipient to decide where the data should be attached; the intent does not specify the ultimate destination.

Input: getData() is URI of data to be attached.

Output: nothing.

See Also:
Constant Field Values

ACTION_EDIT

public static final String ACTION_EDIT
Activity Action: Provide explicit editable access to the given data.

Input: getData() is URI of data to be edited.

Output: nothing.

See Also:
Constant Field Values

ACTION_INSERT_OR_EDIT

public static final String ACTION_INSERT_OR_EDIT
Activity Action: Pick an existing item, or insert a new item, and then edit it.

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.

See Also:
Constant Field Values

ACTION_PICK

public static final String ACTION_PICK
Activity Action: Pick an item from the data, returning what was selected.

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.

See Also:
Constant Field Values

ACTION_CREATE_SHORTCUT

public static final String ACTION_CREATE_SHORTCUT
Activity Action: Creates a shortcut.

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).

See Also:
EXTRA_SHORTCUT_INTENT, EXTRA_SHORTCUT_NAME, EXTRA_SHORTCUT_ICON, EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource, Constant Field Values

EXTRA_SHORTCUT_INTENT

public static final String EXTRA_SHORTCUT_INTENT
The name of the extra used to define the Intent of a shortcut.

See Also:
ACTION_CREATE_SHORTCUT, Constant Field Values

EXTRA_SHORTCUT_NAME

public static final String EXTRA_SHORTCUT_NAME
The name of the extra used to define the name of a shortcut.

See Also:
ACTION_CREATE_SHORTCUT, Constant Field Values

EXTRA_SHORTCUT_ICON

public static final String EXTRA_SHORTCUT_ICON
The name of the extra used to define the icon, as a Bitmap, of a shortcut.

See Also:
ACTION_CREATE_SHORTCUT, Constant Field Values

EXTRA_SHORTCUT_ICON_RESOURCE

public static final String EXTRA_SHORTCUT_ICON_RESOURCE
The name of the extra used to define the icon, as a ShortcutIconResource, of a shortcut.

See Also:
ACTION_CREATE_SHORTCUT, Intent.ShortcutIconResource, Constant Field Values

ACTION_CHOOSER

public static final String ACTION_CHOOSER
Activity Action: Display an activity chooser, allowing the user to pick what they want to before proceeding. This can be used as an alternative to the standard activity picker that is displayed by the system when you try to start an activity with multiple possible matches, with these differences in behavior:

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(android.content.Intent, java.lang.CharSequence) function.

Input: No data should be specified. get*Extra 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.

See Also:
Constant Field Values

ACTION_GET_CONTENT

public static final String ACTION_GET_CONTENT
Activity Action: Allow the user to select a particular kind of data and return it. This is different than ACTION_PICK in that here we just say what kind of data is desired, not a URI of existing data from which the user can pick. A ACTION_GET_CONTENT could allow the user to create the data as it runs (for example taking a picture or recording a sound), let them browser over the web and download the desired data, etc.

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 Context.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(android.content.Intent, java.lang.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.

See Also:
Constant Field Values

ACTION_DIAL

public static final String ACTION_DIAL
Activity Action: Dial a number as specified by the data. This shows a UI with the number being dialed, allowing the user to explicitly initiate the call.

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.

See Also:
Constant Field Values

ACTION_CALL

public static final String ACTION_CALL
Activity Action: Perform a call to someone specified by the data.

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.

See Also:
Constant Field Values

ACTION_CALL_EMERGENCY

public static final String ACTION_CALL_EMERGENCY
Activity Action: Perform a call to an emergency number specified by the data.

Input: getData() is URI of a phone number to be dialed or a tel: URI of an explicit phone number.

Output: nothing.

See Also:
Constant Field Values

ACTION_CALL_PRIVILEGED

public static final String ACTION_CALL_PRIVILEGED
Activity action: Perform a call to any number (emergency or not) specified by the data.

Input: getData() is URI of a phone number to be dialed or a tel: URI of an explicit phone number.

Output: nothing.

See Also:
Constant Field Values

ACTION_SENDTO

public static final String ACTION_SENDTO
Activity Action: Send a message to someone specified by the data.

Input: getData() is URI describing the target.

Output: nothing.

See Also:
Constant Field Values

ACTION_SEND

public static final String ACTION_SEND
Activity Action: Deliver some data to someone else. Who the data is being delivered to is not specified; it is up to the receiver of this action to ask the user where the data should be sent.

When launching a SEND intent, you should usually wrap it in a chooser (through createChooser(android.content.Intent, java.lang.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. get*Extra 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.

See Also:
Constant Field Values

ACTION_ANSWER

public static final String ACTION_ANSWER
Activity Action: Handle an incoming phone call.

Input: nothing.

Output: nothing.

See Also:
Constant Field Values

ACTION_INSERT

public static final String ACTION_INSERT
Activity Action: Insert an empty item into the given container.

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.

See Also:
Constant Field Values

ACTION_DELETE

public static final String ACTION_DELETE
Activity Action: Delete the given data from its container.

Input: getData() is URI of data to be deleted.

Output: nothing.

See Also:
Constant Field Values

ACTION_RUN

public static final String ACTION_RUN
Activity Action: Run the data, whatever that means.

Input: ? (Note: this is currently specific to the test harness.)

Output: nothing.

See Also:
Constant Field Values

ACTION_SYNC

public static final String ACTION_SYNC
Activity Action: Perform a data synchronization.

Input: ?

Output: ?

See Also:
Constant Field Values

ACTION_PICK_ACTIVITY

public static final String ACTION_PICK_ACTIVITY
Activity Action: Pick an activity given an intent, returning the class selected.

Input: get*Extra field EXTRA_INTENT is an Intent used with PackageManager.queryIntentActivities(android.content.Intent, int) to determine the set of activities from which to pick.

Output: Class name of the activity that was selected.

See Also:
Constant Field Values

ACTION_SEARCH

public static final String ACTION_SEARCH
Activity Action: Perform a search.

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.

See Also:
Constant Field Values

ACTION_WEB_SEARCH

public static final String ACTION_WEB_SEARCH
Activity Action: Perform a web search.

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.

See Also:
Constant Field Values

ACTION_ALL_APPS

public static final String ACTION_ALL_APPS
Activity Action: List all available applications

Input: Nothing.

Output: nothing.

See Also:
Constant Field Values

ACTION_SET_WALLPAPER

public static final String ACTION_SET_WALLPAPER
Activity Action: Show settings for choosing wallpaper

Input: Nothing.

Output: Nothing.

See Also:
Constant Field Values

ACTION_BUG_REPORT

public static final String ACTION_BUG_REPORT
Activity Action: Show activity for reporting a bug.

Input: Nothing.

Output: Nothing.

See Also:
Constant Field Values

ACTION_FACTORY_TEST

public static final String ACTION_FACTORY_TEST
Activity Action: Main entry point for factory tests. Only used when the device is booting in factory test node. The implementing package must be installed in the system image.

Input: nothing

Output: nothing

See Also:
Constant Field Values

ACTION_CALL_BUTTON

public static final String ACTION_CALL_BUTTON
Activity Action: The user pressed the "call" button to go to the dialer or other appropriate UI for placing a call.

Input: Nothing.

Output: Nothing.

See Also:
Constant Field Values

ACTION_VOICE_COMMAND

public static final String ACTION_VOICE_COMMAND
Activity Action: Start Voice Command.

Input: Nothing.

Output: Nothing.

See Also:
Constant Field Values

ACTION_SCREEN_OFF

public static final String ACTION_SCREEN_OFF
Broadcast Action: Sent after the screen turns off.

See Also:
Constant Field Values

ACTION_SCREEN_ON

public static final String ACTION_SCREEN_ON
Broadcast Action: Sent after the screen turns on.

See Also:
Constant Field Values

ACTION_TIME_TICK

public static final String ACTION_TIME_TICK
Broadcast Action: The current time has changed. Sent every minute. You can not receive this through components declared in manifests, only by exlicitly registering for it with Context.registerReceiver().

See Also:
Constant Field Values

ACTION_TIME_CHANGED

public static final String ACTION_TIME_CHANGED
Broadcast Action: The time was set.

See Also:
Constant Field Values

ACTION_DATE_CHANGED

public static final String ACTION_DATE_CHANGED
Broadcast Action: The date has changed.

See Also:
Constant Field Values

ACTION_TIMEZONE_CHANGED

public static final String ACTION_TIMEZONE_CHANGED
Broadcast Action: The timezone has changed. The intent will have the following extra values:

See Also:
Constant Field Values

ACTION_ALARM_CHANGED

public static final String ACTION_ALARM_CHANGED
Alarm Changed Action: This is broadcast when the AlarmClock application's alarm is set or unset. It is used by the AlarmClock application and the StatusBar service.

See Also:
Constant Field Values

ACTION_SYNC_STATE_CHANGED

public static final String ACTION_SYNC_STATE_CHANGED
Sync State Changed Action: This is broadcast when the sync starts or stops or when one has been failing for a long time. It is used by the SyncManager and the StatusBar service.

See Also:
Constant Field Values

ACTION_BOOT_COMPLETED

public static final String ACTION_BOOT_COMPLETED
Broadcast Action: This is broadcast once, after the system has finished booting. It can be used to perform application-specific initialization, such as installing alarms. You must hold the Manifest.permission.RECEIVE_BOOT_COMPLETED permission in order to receive this broadcast.

See Also:
Constant Field Values

ACTION_CLOSE_SYSTEM_DIALOGS

public static final String ACTION_CLOSE_SYSTEM_DIALOGS
Broadcast Action: This is broadcast when a user action should request a temporary system dialog to dismiss. Some examples of temporary system dialogs are the notification window-shade and the recent tasks dialog.

See Also:
Constant Field Values

ACTION_PACKAGE_INSTALL

public static final String ACTION_PACKAGE_INSTALL
Broadcast Action: Trigger the download and eventual installation of a package.

Input: getData() is the URI of the package file to download.

See Also:
Constant Field Values

ACTION_PACKAGE_ADDED

public static final String ACTION_PACKAGE_ADDED
Broadcast Action: A new application package has been installed on the device. The data contains the name of the package.

See Also:
Constant Field Values

ACTION_PACKAGE_REMOVED

public static final String ACTION_PACKAGE_REMOVED
Broadcast Action: An existing application package has been removed from the device. The data contains the name of the package. The package that is being installed does not receive this Intent.

See Also:
Constant Field Values

ACTION_PACKAGE_CHANGED

public static final String ACTION_PACKAGE_CHANGED
Broadcast Action: An existing application package has been changed (e.g. a component has been enabled or disabled. The data contains the name of the package.

See Also:
Constant Field Values

ACTION_PACKAGE_RESTARTED

public static final 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. The data contains the name of the package.

See Also:
Constant Field Values

ACTION_UID_REMOVED

public static final String ACTION_UID_REMOVED
Broadcast Action: A user ID has been removed from the system. The user ID number is stored in the extra data under EXTRA_UID.

See Also:
Constant Field Values

ACTION_WALLPAPER_CHANGED

public static final String ACTION_WALLPAPER_CHANGED
Broadcast Action: The current system wallpaper has changed. See Context.getWallpaper() for retrieving the new wallpaper.

See Also:
Constant Field Values

ACTION_CONFIGURATION_CHANGED

public static final String ACTION_CONFIGURATION_CHANGED
Broadcast Action: The current device Configuration (orientation, locale, etc) has changed. When such a change happens, the UIs (view hierarchy) will need to be rebuilt based on this new information; for the most part, applications don't need to worry about this, because the system will take care of stopping and restarting the application to make sure it sees the new changes. Some system code that can not be restarted will need to watch for this action and handle it appropriately.

See Also:
Configuration, Constant Field Values

ACTION_BATTERY_CHANGED

public static final String ACTION_BATTERY_CHANGED
Broadcast Action: The charging state, or charge level of the battery has changed.

You can not receive this through components declared in manifests, only by exlicitly registering for it with Context.registerReceiver().

See Also:
Constant Field Values

ACTION_BATTERY_LOW

public static final String ACTION_BATTERY_LOW
Broadcast Action: Indicates low battery condition on the device. This broadcast corresponds to the "Low battery warning" system dialog.

See Also:
Constant Field Values

ACTION_POWER_CONNECTED

public static final String ACTION_POWER_CONNECTED
Broadcast Action: External power has been connected to the device. This is intended for applications that wish to register specifically to this notification. Unlike ACTION_BATTERY_CHANGED, applications will be woken for this and so do not have to stay active to receive this notification. This action can be used to implement actions that wait until power is available to trigger.

See Also:
Constant Field Values

ACTION_POWER_DISCONNECTED

public static final String ACTION_POWER_DISCONNECTED
Broadcast Action: External power has been removed from the device. This is intended for applications that wish to register specifically to this notification. Unlike ACTION_BATTERY_CHANGED, applications will be woken for this and so do not have to stay active to receive this notification. This action can be used to implement actions that wait until power is available to trigger.

See Also:
Constant Field Values

ACTION_DEVICE_STORAGE_LOW

public static final String ACTION_DEVICE_STORAGE_LOW
Broadcast Action: Indicates low memory condition on the device

See Also:
Constant Field Values

ACTION_DEVICE_STORAGE_OK

public static final String ACTION_DEVICE_STORAGE_OK
Broadcast Action: Indicates low memory condition on the device no longer exists

See Also:
Constant Field Values

ACTION_MANAGE_PACKAGE_STORAGE

public static final String ACTION_MANAGE_PACKAGE_STORAGE
Broadcast Action: Indicates low memory condition notification acknowledged by user and package management should be started. This is triggered by the user from the ACTION_DEVICE_STORAGE_LOW notification.

See Also:
Constant Field Values

ACTION_UMS_CONNECTED

public static final String ACTION_UMS_CONNECTED
Broadcast Action: The device has entered USB Mass Storage mode. This is used mainly for the USB Settings panel. Apps should listen for ACTION_MEDIA_MOUNTED and ACTION_MEDIA_UNMOUNTED broadcasts to be notified when the SD card file system is mounted or unmounted

See Also:
Constant Field Values

ACTION_UMS_DISCONNECTED

public static final String ACTION_UMS_DISCONNECTED
Broadcast Action: The device has exited USB Mass Storage mode. This is used mainly for the USB Settings panel. Apps should listen for ACTION_MEDIA_MOUNTED and ACTION_MEDIA_UNMOUNTED broadcasts to be notified when the SD card file system is mounted or unmounted

See Also:
Constant Field Values

ACTION_MEDIA_REMOVED

public static final String ACTION_MEDIA_REMOVED
Broadcast Action: External media has been removed. The path to the mount point for the removed media is contained in the Intent.mData field.

See Also:
Constant Field Values

ACTION_MEDIA_UNMOUNTED

public static final String ACTION_MEDIA_UNMOUNTED
Broadcast Action: External media is present, but not mounted at its mount point. The path to the mount point for the removed media is contained in the Intent.mData field.

See Also:
Constant Field Values

ACTION_MEDIA_MOUNTED

public static final String ACTION_MEDIA_MOUNTED
Broadcast Action: External media is present and mounted at its mount point. The path to the mount point for the removed media is contained in the Intent.mData field. The Intent contains an extra with name "read-only" and Boolean value to indicate if the media was mounted read only.

See Also:
Constant Field Values

ACTION_MEDIA_SHARED

public static final String ACTION_MEDIA_SHARED
Broadcast Action: External media is unmounted because it is being shared via USB mass storage. The path to the mount point for the removed media is contained in the Intent.mData field.

See Also:
Constant Field Values

ACTION_MEDIA_BAD_REMOVAL

public static final String ACTION_MEDIA_BAD_REMOVAL
Broadcast Action: External media was removed from SD card slot, but mount point was not unmounted. The path to the mount point for the removed media is contained in the Intent.mData field.

See Also:
Constant Field Values

ACTION_MEDIA_UNMOUNTABLE

public static final String ACTION_MEDIA_UNMOUNTABLE
Broadcast Action: External media is present but cannot be mounted. The path to the mount point for the removed media is contained in the Intent.mData field.

See Also:
Constant Field Values

ACTION_MEDIA_EJECT

public static final String ACTION_MEDIA_EJECT
Broadcast Action: User has expressed the desire to remove the external storage media. Applications should close all files they have open within the mount point when they receive this intent. The path to the mount point for the media to be ejected is contained in the Intent.mData field.

See Also:
Constant Field Values

ACTION_MEDIA_SCANNER_STARTED

public static final String ACTION_MEDIA_SCANNER_STARTED
Broadcast Action: The media scanner has started scanning a directory. The path to the directory being scanned is contained in the Intent.mData field.

See Also:
Constant Field Values

ACTION_MEDIA_SCANNER_FINISHED

public static final String ACTION_MEDIA_SCANNER_FINISHED
Broadcast Action: The media scanner has finished scanning a directory. The path to the scanned directory is contained in the Intent.mData field.

See Also:
Constant Field Values

ACTION_MEDIA_SCANNER_SCAN_FILE

public static final String ACTION_MEDIA_SCANNER_SCAN_FILE
Broadcast Action: Request the media scanner to scan a file and add it to the media database. The path to the file is contained in the Intent.mData field.

See Also:
Constant Field Values

ACTION_MEDIA_BUTTON

public static final String ACTION_MEDIA_BUTTON
Broadcast Action: The "Media Button" was pressed. Includes a single extra field, EXTRA_KEY_EVENT, containing the key event that caused the broadcast.

See Also:
Constant Field Values

ACTION_CAMERA_BUTTON

public static final String ACTION_CAMERA_BUTTON
Broadcast Action: The "Camera Button" was pressed. Includes a single extra field, EXTRA_KEY_EVENT, containing the key event that caused the broadcast.

See Also:
Constant Field Values

ACTION_GTALK_SERVICE_CONNECTED

public static final String ACTION_GTALK_SERVICE_CONNECTED
Broadcast Action: An GTalk connection has been established.

See Also:
Constant Field Values

ACTION_GTALK_SERVICE_DISCONNECTED

public static final String ACTION_GTALK_SERVICE_DISCONNECTED
Broadcast Action: An GTalk connection has been disconnected.

See Also:
Constant Field Values

ACTION_AIRPLANE_MODE_CHANGED

public static final String ACTION_AIRPLANE_MODE_CHANGED

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:

See Also:
Constant Field Values

ACTION_PROVIDER_CHANGED

public static final 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. For these things, they may broadcast this action when the set of interesting items change. For example, GmailProvider sends this notification when the set of unread mail in the inbox changes.

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:

This intent will be sent at boot (if the count is non-zero) and when the data set changes. It is possible for the data set to change without the count changing (for example, if a new unread message arrives in the same sync operation in which a message is archived). The phone should still ring/vibrate/etc as normal in this case.

See Also:
Constant Field Values

ACTION_HEADSET_PLUG

public static final String ACTION_HEADSET_PLUG
Broadcast Action: Wired Headset plugged in or unplugged.

The intent will have the following extra values:

See Also:
Constant Field Values

ACTION_NEW_OUTGOING_CALL

public static final String ACTION_NEW_OUTGOING_CALL
Broadcast Action: An outgoing call is about to be placed.

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 Manifest.permission.PROCESS_OUTGOING_CALLS permission to receive this Intent.

See Also:
Constant Field Values

ACTION_REBOOT

public static final String ACTION_REBOOT
Broadcast Action: Have the device reboot. This is only for use by system code.

See Also:
Constant Field Values

CATEGORY_DEFAULT

public static final String CATEGORY_DEFAULT
Set if the activity should be an option for the default action (center press) to perform on a piece of data. Setting this will hide from the user any activities without it set when performing an action on some data. Note that this is normal -not- set in the Intent when initiating an action -- it is for use in intent filters specified in packages.

See Also:
Constant Field Values

CATEGORY_BROWSABLE

public static final String CATEGORY_BROWSABLE
Activities that can be safely invoked from a browser must support this category. For example, if the user is viewing a web page or an e-mail and clicks on a link in the text, the Intent generated execute that link will require the BROWSABLE category, so that only activities supporting this category will be considered as possible actions. By supporting this category, you are promising that there is nothing damaging (without user intervention) that can happen by invoking any matching Intent.

See Also:
Constant Field Values

CATEGORY_ALTERNATIVE

public static final String CATEGORY_ALTERNATIVE
Set if the activity should be considered as an alternative action to the data the user is currently viewing. See also CATEGORY_SELECTED_ALTERNATIVE for an alternative action that applies to the selection in a list of items.

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.

See Also:
Constant Field Values

CATEGORY_SELECTED_ALTERNATIVE

public static final String CATEGORY_SELECTED_ALTERNATIVE
Set if the activity should be considered as an alternative selection action to the data the user has currently selected. This is like CATEGORY_ALTERNATIVE, but is used in activities showing a list of items from which the user can select, giving them alternatives to the default action that will be performed on it.

See Also:
Constant Field Values

CATEGORY_TAB

public static final String CATEGORY_TAB
Intended to be used as a tab inside of an containing TabActivity.

See Also:
Constant Field Values

CATEGORY_GADGET

public static final String CATEGORY_GADGET
This activity can be embedded inside of another activity that is hosting gadgets.

See Also:
Constant Field Values

CATEGORY_LAUNCHER

public static final String CATEGORY_LAUNCHER
Should be displayed in the top-level launcher.

See Also:
Constant Field Values

CATEGORY_HOME

public static final String CATEGORY_HOME
This is the home activity, that is the first activity that is displayed when the device boots.

See Also:
Constant Field Values

CATEGORY_PREFERENCE

public static final String CATEGORY_PREFERENCE
This activity is a preference panel.

See Also:
Constant Field Values

CATEGORY_DEVELOPMENT_PREFERENCE

public static final String CATEGORY_DEVELOPMENT_PREFERENCE
This activity is a development preference panel.

See Also:
Constant Field Values

CATEGORY_EMBED

public static final String CATEGORY_EMBED
Capable of running inside a parent activity container.

Note: being removed in favor of more explicit categories such as CATEGORY_GADGET

See Also:
Constant Field Values

CATEGORY_MONKEY

public static final String CATEGORY_MONKEY
This activity may be exercised by the monkey or other automated test tools.

See Also:
Constant Field Values

CATEGORY_TEST

public static final String CATEGORY_TEST
To be used as a test (not part of the normal user experience).

See Also:
Constant Field Values

CATEGORY_UNIT_TEST

public static final String CATEGORY_UNIT_TEST
To be used as a unit test (run through the Test Harness).

See Also:
Constant Field Values

CATEGORY_SAMPLE_CODE

public static final String CATEGORY_SAMPLE_CODE
To be used as an sample code example (not part of the normal user experience).

See Also:
Constant Field Values

CATEGORY_OPENABLE

public static final String CATEGORY_OPENABLE
Used to indicate that a GET_CONTENT intent only wants URIs that can be opened with ContentResolver.openInputStream. Openable URIs must support the columns in OpenableColumns when queried, though it is allowable for those columns to be blank.

See Also:
Constant Field Values

CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST

public static final String CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST
To be used as code under test for framework instrumentation tests.

See Also:
Constant Field Values

EXTRA_TEMPLATE

public static final String EXTRA_TEMPLATE
The initial data to place in a newly created record. Use with ACTION_INSERT. The data here is a Map containing the same fields as would be given to the underlying ContentProvider.insert() call.

See Also:
Constant Field Values

EXTRA_TEXT

public static final String EXTRA_TEXT
A constant CharSequence that is associated with the Intent, used with ACTION_SEND to supply the literal data to be sent. Note that this may be a styled CharSequence, so you must use Bundle.getCharSequence() to retrieve it.

See Also:
Constant Field Values

EXTRA_STREAM

public static final 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.

See Also:
Constant Field Values

EXTRA_EMAIL

public static final String EXTRA_EMAIL
A String[] holding e-mail addresses that should be delivered to.

See Also:
Constant Field Values

EXTRA_CC

public static final String EXTRA_CC
A String[] holding e-mail addresses that should be carbon copied.

See Also:
Constant Field Values

EXTRA_BCC

public static final String EXTRA_BCC
A String[] holding e-mail addresses that should be blind carbon copied.

See Also:
Constant Field Values

EXTRA_SUBJECT

public static final String EXTRA_SUBJECT
A constant string holding the desired subject line of a message.

See Also:
Constant Field Values

EXTRA_INTENT

public static final String EXTRA_INTENT
An Intent describing the choices you would like shown with ACTION_PICK_ACTIVITY.

See Also:
Constant Field Values

EXTRA_TITLE

public static final String EXTRA_TITLE
A CharSequence dialog title to provide to the user when used with a ACTION_CHOOSER.

See Also:
Constant Field Values

EXTRA_KEY_EVENT

public static final String EXTRA_KEY_EVENT
A KeyEvent object containing the event that triggered the creation of the Intent it is in.

See Also:
Constant Field Values

EXTRA_DONT_KILL_APP

public static final 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.

See Also:
Constant Field Values

EXTRA_PHONE_NUMBER

public static final 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.

See Also:
Constant Field Values

EXTRA_UID

public static final String EXTRA_UID
Used as an int extra field in ACTION_UID_REMOVED intents to supply the uid the package had been assigned. Also an optional extra in ACTION_PACKAGE_REMOVED or ACTION_PACKAGE_CHANGED for the same purpose.

See Also:
Constant Field Values

EXTRA_ALARM_COUNT

public static final 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. For one-shot alarms this will always be 1. For recurring alarms, this might be greater than 1 if the device was asleep or powered off at the time an earlier alarm would have been delivered.

See Also:
Constant Field Values

FLAG_GRANT_READ_URI_PERMISSION

public static final 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.

See Also:
Constant Field Values

FLAG_GRANT_WRITE_URI_PERMISSION

public static final 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.

See Also:
Constant Field Values

FLAG_FROM_BACKGROUND

public static final 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.

See Also:
Constant Field Values

FLAG_DEBUG_LOG_RESOLUTION

public static final 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.

See Also:
Constant Field Values

FLAG_ACTIVITY_NO_HISTORY

public static final int FLAG_ACTIVITY_NO_HISTORY
If set, the new activity is not kept in the history stack.

See Also:
Constant Field Values

FLAG_ACTIVITY_SINGLE_TOP

public static final 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.

See Also:
Constant Field Values

FLAG_ACTIVITY_NEW_TASK

public static final int FLAG_ACTIVITY_NEW_TASK
If set, this activity will become the start of a new task on this history stack. A task (from the activity that started it to the next task activity) defines an atomic group of activities that the user can move to. Tasks can be moved to the foreground and background; all of the activities inside of a particular task always remain in the same order. 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.

See Also:
Constant Field Values

FLAG_ACTIVITY_MULTIPLE_TASK

public static final int FLAG_ACTIVITY_MULTIPLE_TASK
Do not use this flag unless you are implementing your own top-level application launcher. Used in conjunction with FLAG_ACTIVITY_NEW_TASK to disable the behavior of bringing an existing task to the foreground. When set, a new task is always started to host the Activity for the Intent, regardless of whether there is already an existing task running the same thing.

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.

See Also:
Constant Field Values

FLAG_ACTIVITY_CLEAR_TOP

public static final 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.

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.

See Also:
Constant Field Values

FLAG_ACTIVITY_FORWARD_RESULT

public static final 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. This way the new activity can call Activity.setResult(int) and have that result sent back to the reply target of the original activity.

See Also:
Constant Field Values

FLAG_ACTIVITY_PREVIOUS_IS_TOP

public static final 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. The previous activity will be used as the top, with the assumption being that the current activity will finish itself immediately.

See Also:
Constant Field Values

FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS

public static final int FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
If set, the new activity is not kept in the list of recently launched activities.

See Also:
Constant Field Values

FLAG_ACTIVITY_BROUGHT_TO_FRONT

public static final 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.

See Also:
Constant Field Values

FLAG_ACTIVITY_RESET_TASK_IF_NEEDED

public static final 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. This will result in the application of any affinities needed to have that task in the proper state (either moving activities to or from it), or simply resetting that task to its initial state if needed.

See Also:
Constant Field Values

FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY

public static final int FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY
If set, this activity is being launched from history (longpress home key).

See Also:
Constant Field Values

FLAG_RECEIVER_REGISTERED_ONLY

public static final int FLAG_RECEIVER_REGISTERED_ONLY
If set, when sending a broadcast only registered receivers will be called -- no BroadcastReceiver components will be launched.

See Also:
Constant Field Values

FILL_IN_ACTION

public static final int FILL_IN_ACTION
Use with fillIn(android.content.Intent, int) to allow the current action value to be overwritten, even if it is already set.

See Also:
Constant Field Values

FILL_IN_DATA

public static final int FILL_IN_DATA
Use with fillIn(android.content.Intent, int) to allow the current data or type value overwritten, even if it is already set.

See Also:
Constant Field Values

FILL_IN_CATEGORIES

public static final int FILL_IN_CATEGORIES
Use with fillIn(android.content.Intent, int) to allow the current categories to be overwritten, even if they are already set.

See Also:
Constant Field Values

FILL_IN_COMPONENT

public static final int FILL_IN_COMPONENT
Use with fillIn(android.content.Intent, int) to allow the current component value to be overwritten, even if it is already set.

See Also:
Constant Field Values

CREATOR

public static final Parcelable.Creator<Intent> CREATOR
Constructor Detail

Intent

public Intent()
Create an empty intent.


Intent

public Intent(Intent o)
Copy constructor.


Intent

public Intent(String action)
Create an intent with a given action. All other fields (data, type, class) are null. Note that the action must be in a namespace because Intents are used globally in the system -- for example the system VIEW action is android.intent.action.VIEW; an application's custom action would be something like com.google.app.myapp.CUSTOM_ACTION.

Parameters:
action - The Intent action, such as ACTION_VIEW.

Intent

public Intent(String action,
              Uri uri)
Create an intent with a given action and for a given data url. Note that the action must be in a namespace because Intents are used globally in the system -- for example the system VIEW action is android.intent.action.VIEW; an application's custom action would be something like com.google.app.myapp.CUSTOM_ACTION.

Parameters:
action - The Intent action, such as ACTION_VIEW.
uri - The Intent data URI.

Intent

public Intent(Context packageContext,
              Class<?> cls)
Create an intent for a specific component. All other fields (action, data, type, class) are null, though they can be modified later with explicit calls. This provides a convenient way to create an intent that is intended to execute a hard-coded class name, rather than relying on the system to find an appropriate class for you; see setComponent(android.content.ComponentName) for more information on the repercussions of this.

Parameters:
packageContext - A Context of the application package implementing this class.
cls - The component class that is to be used for the intent.
See Also:
setClass(android.content.Context, java.lang.Class), setComponent(android.content.ComponentName), Intent(String, android.net.Uri , Context, Class)

Intent

public Intent(String action,
              Uri uri,
              Context packageContext,
              Class<?> cls)
Create an intent for a specific component with a specified action and data. This is equivalent using Intent(String, android.net.Uri) to construct the Intent and then calling setClass(android.content.Context, java.lang.Class) to set its class.

Parameters:
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.
See Also:
Intent(String, android.net.Uri), Intent(Context, Class), setClass(android.content.Context, java.lang.Class), setComponent(android.content.ComponentName)
Method Detail

createChooser

public static Intent createChooser(Intent target,
                                   CharSequence title)
Convenience function for creating a ACTION_CHOOSER Intent.

Parameters:
target - The Intent that the user will be selecting an activity to perform.
title - Optional title that will be displayed in the chooser.
Returns:
Return a new Intent object that you can hand to Context.startActivity() and related methods.

clone

public Object clone()
Description copied from class: Object
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.

Classes which wish to support cloning must specify that they implement the Cloneable interface, since the implementation checks for this.

Overrides:
clone in class Object
Returns:
Object a shallow copy of this object.

cloneFilter

public 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.


getIntent

public static Intent getIntent(String uri)
                        throws URISyntaxException
Create an intent from a URI. This URI may encode the action, category, and other intent fields, if it was returned by toURI(). If the Intent was not generate by toURI(), its data will be the entire URI and its action will be ACTION_VIEW.

The URI given here must not be relative -- that is, it must include the scheme and full path.

Parameters:
uri - The URI to turn into an Intent.
Returns:
Intent The newly created Intent object.
Throws:
URISyntaxException
See Also:
toURI()

getIntentOld

public static Intent getIntentOld(String uri)
                           throws URISyntaxException
Throws:
URISyntaxException

getAction

public String getAction()
Retrieve the general action to be performed, such as ACTION_VIEW. The action describes the general way the rest of the information in the intent should be interpreted -- most importantly, what to do with the data returned by getData().

Returns:
The action of this intent or null if none is specified.
See Also:
setAction(java.lang.String)

getData

public Uri getData()
Retrieve data this intent is operating on. This URI specifies the name of the data; often it uses the content: scheme, specifying data in a content provider. Other schemes may be handled by specific activities, such as http: by the web browser.

Returns:
The URI of the data this intent is targeting or null.
See Also:
getScheme(), setData(android.net.Uri)

getDataString

public String getDataString()
The same as getData(), but returns the URI as an encoded String.


getScheme

public String getScheme()
Return the scheme portion of the intent's data. If the data is null or does not include a scheme, null is returned. Otherwise, the scheme prefix without the final ':' is returned, i.e. "http".

This is the same as calling getData().getScheme() (and checking for null data).

Returns:
The scheme of this intent.
See Also:
getData()

getType

public String getType()
Retrieve any explicit MIME type included in the intent. This is usually null, as the type is determined by the intent data.

Returns:
If a type was manually set, it is returned; else null is returned.
See Also:
resolveType(ContentResolver), setType(java.lang.String)

resolveType

public String resolveType(Context context)
Return the MIME data type of this intent. If the type field is explicitly set, that is simply returned. Otherwise, if the data is set, the type of that data is returned. If neither fields are set, a null is returned.

Returns:
The MIME type of this intent.
See Also:
getType(), resolveType(ContentResolver)

resolveType

public String resolveType(ContentResolver resolver)
Return the MIME data type of this intent. If the type field is explicitly set, that is simply returned. Otherwise, if the data is set, the type of that data is returned. If neither fields are set, a null is returned.

Parameters:
resolver - A ContentResolver that can be used to determine the MIME type of the intent's data.
Returns:
The MIME type of this intent.
See Also:
getType(), resolveType(Context)

resolveTypeIfNeeded

public String resolveTypeIfNeeded(ContentResolver resolver)
Return the MIME data type of this intent, only if it will be needed for intent resolution. This is not generally useful for application code; it is used by the frameworks for communicating with back-end system services.

Parameters:
resolver - A ContentResolver that can be used to determine the MIME type of the intent's data.
Returns:
The MIME type of this intent, or null if it is unknown or not needed.

hasCategory

public boolean hasCategory(String category)
Check if an category exists in the intent.

Parameters:
category - The category to check.
Returns:
boolean True if the intent contains the category, else false.
See Also:
getCategories(), addCategory(java.lang.String)

getCategories

public Set<String> getCategories()
Return the set of all categories in the intent. If there are no categories, returns NULL.

Returns:
Set The set of categories you can examine. Do not modify!
See Also:
hasCategory(java.lang.String), addCategory(java.lang.String)

setExtrasClassLoader

public void setExtrasClassLoader(ClassLoader loader)
Sets the ClassLoader that will be used when unmarshalling any Parcelable values from the extras of this Intent.

Parameters:
loader - a ClassLoader, or null to use the default loader at the time of unmarshalling.

hasExtra

public boolean hasExtra(String name)
Returns true if an extra value is associated with the given name.

Parameters:
name - the extra's name
Returns:
true if the given extra is present.

hasFileDescriptors

public boolean hasFileDescriptors()
Returns true if the Intent's extras contain a parcelled file descriptor.

Returns:
true if the Intent contains a parcelled file descriptor.

getExtra

@Deprecated
public Object getExtra(String name)
Deprecated. 

Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if none was found.

getBooleanExtra

public boolean getBooleanExtra(String name,
                               boolean defaultValue)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
defaultValue - the value to be returned if no value of the desired type is stored with the given name.
Returns:
the value of an item that previously added with putExtra() or the default value if none was found.
See Also:
putExtra(String, boolean)

getByteExtra

public byte getByteExtra(String name,
                         byte defaultValue)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
defaultValue - the value to be returned if no value of the desired type is stored with the given name.
Returns:
the value of an item that previously added with putExtra() or the default value if none was found.
See Also:
putExtra(String, byte)

getShortExtra

public short getShortExtra(String name,
                           short defaultValue)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
defaultValue - the value to be returned if no value of the desired type is stored with the given name.
Returns:
the value of an item that previously added with putExtra() or the default value if none was found.
See Also:
putExtra(String, short)

getCharExtra

public char getCharExtra(String name,
                         char defaultValue)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
defaultValue - the value to be returned if no value of the desired type is stored with the given name.
Returns:
the value of an item that previously added with putExtra() or the default value if none was found.
See Also:
putExtra(String, char)

getIntExtra

public int getIntExtra(String name,
                       int defaultValue)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
defaultValue - the value to be returned if no value of the desired type is stored with the given name.
Returns:
the value of an item that previously added with putExtra() or the default value if none was found.
See Also:
putExtra(String, int)

getLongExtra

public long getLongExtra(String name,
                         long defaultValue)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
defaultValue - the value to be returned if no value of the desired type is stored with the given name.
Returns:
the value of an item that previously added with putExtra() or the default value if none was found.
See Also:
putExtra(String, long)

getFloatExtra

public float getFloatExtra(String name,
                           float defaultValue)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
defaultValue - the value to be returned if no value of the desired type is stored with the given name.
Returns:
the value of an item that previously added with putExtra(), or the default value if no such item is present
See Also:
putExtra(String, float)

getDoubleExtra

public double getDoubleExtra(String name,
                             double defaultValue)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
defaultValue - the value to be returned if no value of the desired type is stored with the given name.
Returns:
the value of an item that previously added with putExtra() or the default value if none was found.
See Also:
putExtra(String, double)

getStringExtra

public String getStringExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no String value was found.
See Also:
putExtra(String, String)

getCharSequenceExtra

public CharSequence getCharSequenceExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no CharSequence value was found.
See Also:
putExtra(String, CharSequence)

getParcelableExtra

public <T extends Parcelable> T getParcelableExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no Parcelable value was found.
See Also:
putExtra(String, Parcelable)

getParcelableArrayExtra

public Parcelable[] getParcelableArrayExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no Parcelable[] value was found.
See Also:
putExtra(String, Parcelable[])

getParcelableArrayListExtra

public <T extends Parcelable> ArrayList<T> getParcelableArrayListExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no ArrayList value was found.
See Also:
putParcelableArrayListExtra(String, ArrayList)

getSerializableExtra

public Serializable getSerializableExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no Serializable value was found.
See Also:
putExtra(String, Serializable)

getIntegerArrayListExtra

public ArrayList<Integer> getIntegerArrayListExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no ArrayList value was found.
See Also:
putIntegerArrayListExtra(String, ArrayList)

getStringArrayListExtra

public ArrayList<String> getStringArrayListExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no ArrayList value was found.
See Also:
putStringArrayListExtra(String, ArrayList)

getBooleanArrayExtra

public boolean[] getBooleanArrayExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no boolean array value was found.
See Also:
putExtra(String, boolean[])

getByteArrayExtra

public byte[] getByteArrayExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no byte array value was found.
See Also:
putExtra(String, byte[])

getShortArrayExtra

public short[] getShortArrayExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no short array value was found.
See Also:
putExtra(String, short[])

getCharArrayExtra

public char[] getCharArrayExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no char array value was found.
See Also:
putExtra(String, char[])

getIntArrayExtra

public int[] getIntArrayExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no int array value was found.
See Also:
putExtra(String, int[])

getLongArrayExtra

public long[] getLongArrayExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no long array value was found.
See Also:
putExtra(String, long[])

getFloatArrayExtra

public float[] getFloatArrayExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no float array value was found.
See Also:
putExtra(String, float[])

getDoubleArrayExtra

public double[] getDoubleArrayExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no double array value was found.
See Also:
putExtra(String, double[])

getStringArrayExtra

public String[] getStringArrayExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no String array value was found.
See Also:
putExtra(String, String[])

getBundleExtra

public Bundle getBundleExtra(String name)
Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no Bundle value was found.
See Also:
putExtra(String, Bundle)

getIBinderExtra

@Deprecated
public IBinder getIBinderExtra(String name)
Deprecated. 

Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
Returns:
the value of an item that previously added with putExtra() or null if no IBinder value was found.
See Also:
putExtra(String, IBinder)

getExtra

@Deprecated
public Object getExtra(String name,
                                  Object defaultValue)
Deprecated. 

Retrieve extended data from the intent.

Parameters:
name - The name of the desired item.
defaultValue - The default value to return in case no item is associated with the key 'name'
Returns:
the value of an item that previously added with putExtra() or defaultValue if none was found.
See Also:
putExtra(java.lang.String, boolean)

getExtras

public Bundle getExtras()
Retrieves a map of extended data from the intent.

Returns:
the map of all extras previously added with putExtra(), or null if none have been added.

getFlags

public int getFlags()
Retrieve any special flags associated with this intent. You will normally just set them with setFlags(int) and let the system take the appropriate action with them.

Returns:
int The currently set flags.
See Also:
setFlags(int)

getComponent

public ComponentName getComponent()
Retrieve the concrete component associated with the intent. When receiving an intent, this is the component that was found to best handle it (that is, yourself) and will always be non-null; in all other cases it will be null unless explicitly set.

Returns:
The name of the application component to handle the intent.
See Also:
resolveActivity(android.content.pm.PackageManager), setComponent(android.content.ComponentName)

resolveActivity

public ComponentName resolveActivity(PackageManager pm)
Return the Activity component that should be used to handle this intent. The appropriate component is determined based on the information in the intent, evaluated as follows:

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(android.content.Context) returns non-NULL, the activity must handle this type.

If addCategory(java.lang.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 PackageManager.resolveActivity(android.content.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.

Parameters:
pm - The package manager with which to resolve the Intent.
Returns:
Name of the component implementing an activity that can display the intent.
See Also:
setComponent(android.content.ComponentName), getComponent(), resolveActivityInfo(android.content.pm.PackageManager, int)

resolveActivityInfo

public ActivityInfo resolveActivityInfo(PackageManager pm,
                                        int flags)
Resolve the Intent into an ActivityInfo describing the activity that should execute the intent. Resolution follows the same rules as described for resolveActivity(android.content.pm.PackageManager), but you get back the completely information about the resolved activity instead of just its class name.

Parameters:
pm - The package manager with which to resolve the Intent.
flags - Addition information to retrieve as per PackageManager.getActivityInfo().
Returns:
PackageManager.ActivityInfo
See Also:
resolveActivity(android.content.pm.PackageManager)

setAction

public Intent setAction(String action)
Set the general action to be performed.

Parameters:
action - An action name, such as ACTION_VIEW. Application-specific actions should be prefixed with the vendor's package name.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
getAction()

setData

public Intent setData(Uri data)
Set the data this intent is operating on. This method automatically clears any type that was previously set by setType(java.lang.String).

Parameters:
data - The URI of the data this intent is now targeting.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
getData(), setType(java.lang.String), setDataAndType(android.net.Uri, java.lang.String)

setType

public Intent setType(String type)
Set an explicit MIME data type. This is used to create intents that only specify a type and not data, for example to indicate the type of data to return. This method automatically clears any data that was previously set by setData(android.net.Uri).

Parameters:
type - The MIME type of the data being handled by this intent.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
getType(), setData(android.net.Uri), setDataAndType(android.net.Uri, java.lang.String)

setDataAndType

public Intent setDataAndType(Uri data,
                             String type)
(Usually optional) Set the data for the intent along with an explicit MIME data type. This method should very rarely be used -- it allows you to override the MIME type that would ordinarily be inferred from the data with your own type given here.

Parameters:
data - The URI of the data this intent is now targeting.
type - The MIME type of the data being handled by this intent.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
setData(android.net.Uri), setType(java.lang.String)

addCategory

public Intent addCategory(String category)
Add a new category to the intent. Categories provide additional detail about the action the intent is perform. When resolving an intent, only activities that provide all of the requested categories will be used.

Parameters:
category - The desired category. This can be either one of the predefined Intent categories, or a custom category in your own namespace.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
hasCategory(java.lang.String), removeCategory(java.lang.String)

removeCategory

public void removeCategory(String category)
Remove an category from an intent.

Parameters:
category - The category to remove.
See Also:
addCategory(java.lang.String)

putExtra

public Intent putExtra(String name,
                       boolean value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The boolean data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getBooleanExtra(String, boolean)

putExtra

public Intent putExtra(String name,
                       byte value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The byte data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getByteExtra(String, byte)

putExtra

public Intent putExtra(String name,
                       char value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The char data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getCharExtra(String, char)

putExtra

public Intent putExtra(String name,
                       short value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The short data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getShortExtra(String, short)

putExtra

public Intent putExtra(String name,
                       int value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The integer data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getIntExtra(String, int)

putExtra

public Intent putExtra(String name,
                       long value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The long data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getLongExtra(String, long)

putExtra

public Intent putExtra(String name,
                       float value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The float data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getFloatExtra(String, float)

putExtra

public Intent putExtra(String name,
                       double value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The double data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getDoubleExtra(String, double)

putExtra

public Intent putExtra(String name,
                       String value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The String data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getStringExtra(String)

putExtra

public Intent putExtra(String name,
                       CharSequence value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The CharSequence data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getCharSequenceExtra(String)

putExtra

public Intent putExtra(String name,
                       Parcelable value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The Parcelable data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getParcelableExtra(String)

putExtra

public Intent putExtra(String name,
                       Parcelable[] value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The Parcelable[] data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getParcelableArrayExtra(String)

putParcelableArrayListExtra

public Intent putParcelableArrayListExtra(String name,
                                          ArrayList<? extends Parcelable> value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The ArrayList data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getParcelableArrayListExtra(String)

putIntegerArrayListExtra

public Intent putIntegerArrayListExtra(String name,
                                       ArrayList<Integer> value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The ArrayList data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getIntegerArrayListExtra(String)

putStringArrayListExtra

public Intent putStringArrayListExtra(String name,
                                      ArrayList<String> value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The ArrayList data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getStringArrayListExtra(String)

putExtra

public Intent putExtra(String name,
                       Serializable value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The Serializable data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getSerializableExtra(String)

putExtra

public Intent putExtra(String name,
                       boolean[] value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The boolean array data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getBooleanArrayExtra(String)

putExtra

public Intent putExtra(String name,
                       byte[] value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The byte array data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getByteArrayExtra(String)

putExtra

public Intent putExtra(String name,
                       short[] value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The short array data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getShortArrayExtra(String)

putExtra

public Intent putExtra(String name,
                       char[] value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The char array data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getCharArrayExtra(String)

putExtra

public Intent putExtra(String name,
                       int[] value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The int array data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getIntArrayExtra(String)

putExtra

public Intent putExtra(String name,
                       long[] value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The byte array data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getLongArrayExtra(String)

putExtra

public Intent putExtra(String name,
                       float[] value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The float array data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getFloatArrayExtra(String)

putExtra

public Intent putExtra(String name,
                       double[] value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The double array data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getDoubleArrayExtra(String)

putExtra

public Intent putExtra(String name,
                       String[] value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The String array data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getStringArrayExtra(String)

putExtra

public Intent putExtra(String name,
                       Bundle value)
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The Bundle data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getBundleExtra(String)

putExtra

@Deprecated
public Intent putExtra(String name,
                                  IBinder value)
Deprecated. 

Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
name - The name of the extra data, with package prefix.
value - The IBinder data value.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
putExtras(android.content.Intent), removeExtra(java.lang.String), getIBinderExtra(String)

putExtras

public Intent putExtras(Intent src)
Copy all extras in 'src' in to this intent.

Parameters:
src - Contains the extras to copy.
See Also:
putExtra(java.lang.String, boolean)

putExtras

public Intent putExtras(Bundle extras)
Add a set of extended data to the intent. The keys must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".

Parameters:
extras - The Bundle of extras to add to this intent.
See Also:
putExtra(java.lang.String, boolean), removeExtra(java.lang.String)

removeExtra

public void removeExtra(String name)
Remove extended data from the intent.

See Also:
putExtra(java.lang.String, boolean)

setFlags

public Intent setFlags(int flags)
Set special flags controlling how this intent is handled. Most values here depend on the type of component being executed by the Intent, specifically the FLAG_ACTIVITY_* flags are all for use with Context.startActivity() and the FLAG_RECEIVER_* flags are all for use with Context.sendBroadcast().

See the Application Model documentation for important information on how some of these options impact the behavior of your application.

Parameters:
flags - The desired flags.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
getFlags(), addFlags(int), FLAG_GRANT_READ_URI_PERMISSION, FLAG_GRANT_WRITE_URI_PERMISSION, FLAG_DEBUG_LOG_RESOLUTION, FLAG_FROM_BACKGROUND, FLAG_ACTIVITY_RESET_TASK_IF_NEEDED, FLAG_ACTIVITY_BROUGHT_TO_FRONT, FLAG_ACTIVITY_CLEAR_TOP, FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS, FLAG_ACTIVITY_FORWARD_RESULT, FLAG_ACTIVITY_MULTIPLE_TASK, FLAG_ACTIVITY_NEW_TASK, FLAG_ACTIVITY_NO_HISTORY, FLAG_ACTIVITY_SINGLE_TOP, FLAG_RECEIVER_REGISTERED_ONLY

addFlags

public Intent addFlags(int flags)
Add additional flags to the intent (or with existing flags value).

Parameters:
flags - The new flags to set.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
setFlags(int)

setComponent

public Intent setComponent(ComponentName component)
(Usually optional) Explicitly set the component to handle the intent. If left with the default value of null, the system will determine the appropriate class to use based on the other fields (action, data, type, categories) in the Intent. If this class is defined, the specified class will always be used regardless of the other fields. You should only set this value when you know you absolutely want a specific class to be used; otherwise it is better to let the system find the appropriate class so that you will respect the installed applications and user preferences.

Parameters:
component - The name of the application component to handle the intent, or null to let the system find one for you.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
setClass(android.content.Context, java.lang.Class), setClassName(Context, String), setClassName(String, String), getComponent(), resolveActivity(android.content.pm.PackageManager)

setClassName

public Intent setClassName(Context packageContext,
                           String className)
Convenience for calling setComponent(android.content.ComponentName) with an explicit class name.

Parameters:
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.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
setComponent(android.content.ComponentName), setClass(android.content.Context, java.lang.Class)

setClassName

public Intent setClassName(String packageName,
                           String className)
Convenience for calling setComponent(android.content.ComponentName) with an explicit application package name and class name.

Parameters:
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.
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
setComponent(android.content.ComponentName), setClass(android.content.Context, java.lang.Class)

setClass

public Intent setClass(Context packageContext,
                       Class<?> cls)
Convenience for calling setComponent(ComponentName) with the name returned by a Class object.

Parameters:
packageContext - A Context of the application package implementing this class.
cls - The class name to set, equivalent to setClassName(context, cls.getName()).
Returns:
Returns the same Intent object, for chaining multiple calls into a single statement.
See Also:
setComponent(android.content.ComponentName)

fillIn

public 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. For purposes of a field being defined, the following pieces of data in the Intent are considered to be separate fields:

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"}.

Parameters:
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.
Returns:
Returns a bit mask of FILL_IN_ACTION, FILL_IN_DATA, FILL_IN_CATEGORIES, and FILL_IN_COMPONENT indicating which fields were changed.

filterEquals

public boolean filterEquals(Intent other)
Determine if two intents are the same for the purposes of intent resolution (filtering). That is, if their action, data, type, class, and categories are the same. This does not compare any extra data included in the intents.

Parameters:
other - The other Intent to compare against.
Returns:
Returns true if action, data, type, class, and categories are the same.

filterHashCode

public int filterHashCode()
Generate hash code that matches semantics of filterEquals().

Returns:
Returns the hash value of the action, data, type, class, and categories.
See Also:
filterEquals(android.content.Intent)

toString

public String toString()
Description copied from class: Object
Returns a string containing a concise, human-readable description of the receiver.

Overrides:
toString in class Object
Returns:
String a printable representation for the receiver.

toURI

public String toURI()

describeContents

public int describeContents()
Description copied from interface: Parcelable
Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Specified by:
describeContents in interface Parcelable
Returns:
a bitmask indicating the set of special object types marshalled by the Parcelable.

writeToParcel

public void writeToParcel(Parcel out,
                          int flags)
Description copied from interface: Parcelable
Flatten this object in to a Parcel.

Specified by:
writeToParcel in interface Parcelable
Parameters:
out - The Parcel in which the object should be written.
flags - Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.

readFromParcel

public void readFromParcel(Parcel in)

parseIntent

public static Intent parseIntent(Resources resources,
                                 XmlPullParser parser,
                                 AttributeSet attrs)
                          throws XmlPullParserException,
                                 IOException
Parses the "intent" element (and its children) from XML and instantiates an Intent object. The given XML parser should be located at the tag where parsing should start (often named "intent"), from which the basic action, data, type, and package and class name will be retrieved. The function will then parse in to any child elements, looking for tags to add categories and to attach extra data to the intent.

Parameters:
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.
Returns:
An Intent object matching the XML data.
Throws:
XmlPullParserException - If there was an XML parsing error.
IOException - If there was an I/O error.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature