Android Guides | Samples

Android.Content.Intent Class

An intent is an abstract description of an operation to be performed.

See Also: Intent

Syntax

[Android.Runtime.Register("android/content/Intent", DoNotGenerateAcw=true)]
public class Intent : Object, IParcelable, ICloneable, IDisposable

Remarks

An intent is an abstract description of an operation to be performed. It can be used with Context.StartActivity(Intent) to launch an Activity, Context.SendBroadcast(Intent) to send it to any interested BroadcastReceiver components, and Context.StartService(Intent) or Context.BindService(Intent,IServiceConnection,IServiceConnection) 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.

Developer Guides

For information about how to create and resolve intents, read the Intents and Intent Filters developer guide.

Intent Structure

The primary pieces of information in an intent are:

action -- The general action to be performed, such as Intent.ActionView, Intent.ActionEdit, Intent.ActionMain, etc.

data -- The data to operate on, such as a person record in the contacts database, expressed as a Uri.

Some examples of action/data pairs are:

Intent.ActionViewcontent://contacts/people/1 -- Display information about the person whose identifier is "1".

Intent.ActionDialcontent://contacts/people/1 -- Display the phone dialer with the person filled in.

Intent.ActionViewtel:123 -- Display the phone dialer with the given number filled in. Note how the VIEW action does what what is considered the most reasonable thing for a particular URI.

Intent.ActionDialtel:123 -- Display the phone dialer with the given number filled in.

Intent.ActionEditcontent://contacts/people/1 -- Edit information about the person whose identifier is "1".

Intent.ActionViewcontent://contacts/people/ -- Display a list of people, which the user can browse through. This example is a typical top-level entry into the Contacts application, showing you the list of people. Selecting a particular person to view would result in a new intent { Intent.ActionViewcontent://contacts/N } being used to start an activity to display that person.

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

category -- Gives additional information about the action to execute. For example, Intent.CategoryLauncher means it should appear in the Launcher as a top-level application, while Intent.CategoryAlternative means it should be included in a list of alternative actions the user can perform on a piece of data.

type -- Specifies an explicit type (a MIME type) of the intent data. Normally the type is inferred from the data itself. By setting this attribute, you disable that evaluation and force an explicit type.

component -- Specifies an explicit name of a component class to use for the intent. Normally this is determined by looking at the other information in the intent (the action, data/type, and categories) and matching that with a component that can handle it. If this attribute is set then none of the evaluation is performed, and this component is used exactly as is. By specifying this attribute, all of the other Intent attributes become optional.

extras -- This is a Bundle of any additional information. This can be used to provide extended information to the component. For example, if we have a action to send an e-mail message, we could also include extra pieces of data here to supply a subject, body, etc.

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

Intent.ActionMain with category Intent.CategoryHome -- Launch the home screen.

Intent.ActionGetContent with MIME type NoType:android/provider/Contacts$Phones;Href=../../../reference/android/provider/Contacts.Phones.html#CONTENT_URI -- Display the list of people's phone numbers, allowing the user to browse through them and pick one and return it to the parent activity.

Intent.ActionGetContent with MIME type */* and category Intent.CategoryOpenable -- Display all pickers for data that can be opened with ContentResolver.OpenInputStream(Uri), allowing the user to pick one of them and then some data inside of it and returning the resulting URI to the caller. This can be used, for example, in an e-mail application to allow the user to pick some data to include as an attachment.

There are a variety of standard Intent action and category constants defined in the Intent class, but applications can also define their own. These strings use java style scoping, to ensure they are unique -- for example, the standard Intent.ActionView is called "android.intent.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.

  • Explicit Intents have specified a component (via Intent.SetComponent(ComponentName) or Intent.setClass(android.content.Context, java.lang.Class<?>)), which provides the exact class to be run. Often these will not include any other information, simply being a way for an application to launch various internal activities it has as the user interacts with the application.
  • Implicit Intents have not specified a component; instead, they must include enough information for the system to determine which of the available components is best to run for that intent.

When using implicit intents, given such an arbitrary intent we need to know what to do with it. This is handled by the process of Intent resolution, which maps an Intent to an Activity, BroadcastReceiver, or Service (or sometimes two or more activities/receivers) that can handle it.

The intent resolution mechanism basically revolves around matching an Intent against all of the <intent-filter> descriptions in the installed application packages. (Plus, in the case of broadcasts, any BroadcastReceiver objects explicitly registered with Context.RegisterReceiver(BroadcastReceiver,IntentFilter).) More details on this can be found in the documentation on the IntentFilter class.

There are three pieces of information in the Intent that are used for resolution: the action, type, and category. Using this information, a query is done on the PackageManager for a component that can handle the intent. The appropriate component is determined based on the intent information supplied in the AndroidManifest.xml file as follows:

  • For data that is not a content: URI and where no explicit type is included in the Intent, instead the scheme of the intent data (such as http: or mailto:) is considered. Again like the action, if we are matching a scheme it must be listed by the component as one it can handle.

The action, if given, must be listed by the component as one it handles.

The type is retrieved from the Intent's data, if not already supplied in the Intent. Like the action, if a type is included in the intent (either explicitly or implicitly in its data), then this must be listed by the component as one it handles.

The categories, if supplied, must all be listed by the activity as categories it handles. That is, if you include the categories Intent.CategoryLauncher and Intent.CategoryAlternative, then you will only resolve to components with an intent that lists both of those categories. Activities will very often need to support the Intent.CategoryDefault so that they can be found by Context.StartActivity(Intent).

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.

xml Example

 <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:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
                 <action android:name="android.intent.action.EDIT" />
                 <action android:name="android.intent.action.PICK" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <data android:mimeType="vnd.android.cursor.dir/vnd.google.note" />
             </intent-filter>
             <intent-filter>
                 <action android:name="android.intent.action.GET_CONTENT" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <data android:mimeType="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:name="android.intent.action.VIEW" />
                 <action android:name="android.intent.action.EDIT" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <data android:mimeType="vnd.android.cursor.item/vnd.google.note" />
             </intent-filter>

             <intent-filter>
                 <action android:name="android.intent.action.INSERT" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <data android:mimeType="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:name="com.android.notepad.action.EDIT_TITLE" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <category android:name="android.intent.category.ALTERNATIVE" />
                 <category android:name="android.intent.category.SELECTED_ALTERNATIVE" />
                 <data android:mimeType="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. xml Example

     <intent-filter>
         <action android:name="android.intent.action.MAIN" />
         <category android:name="android.intent.category.LAUNCHER" />
     </intent-filter>
  2. xml Example

     <intent-filter>
         <action android:name="android.intent.action.VIEW" />
         <action android:name="android.intent.action.EDIT" />
         <action android:name="android.intent.action.PICK" />
         <category android:name="android.intent.category.DEFAULT" />
         <data mimeType:name="vnd.android.cursor.dir/vnd.google.note" />
     </intent-filter>
  3. xml Example

     <intent-filter>
         <action android:name="android.intent.action.GET_CONTENT" />
         <category android:name="android.intent.category.DEFAULT" />
         <data android:mimeType="vnd.android.cursor.item/vnd.google.note" />
     </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.

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(Intent) method to resolve your activity when its component name is not explicitly specified.

This filter describes the ability return to the caller a note selected by the user without needing to know where it came from. The data type vnd.android.cursor.item/vnd.google.note is a URI from which a Cursor of exactly one (vnd.android.cursor.item) item can be retrieved which contains our note pad data (vnd.google.note). The GET_CONTENT action is similar to the PICK action, where the activity will return to its caller a piece of data selected by the user. Here, however, the caller specifies the type of data they desire instead of the type of data the user will be picking from.

Given these capabilities, the following intents will resolve to the NotesList activity:

{ action=android.app.action.MAIN } matches all of the activities that can be used as top-level entry points into an application.

{ action=android.app.action.MAIN, category=android.app.category.LAUNCHER } is the actual intent used by the Launcher to populate its top-level list.

{ action=android.intent.action.VIEW data=content://com.google.provider.NotePad/notes } displays a list of all the notes under "content://com.google.provider.NotePad/notes", which the user can browse through and see the details on.

{ action=android.app.action.PICK data=content://com.google.provider.NotePad/notes } provides a list of the notes under "content://com.google.provider.NotePad/notes", from which the user can pick a note whose data URL is returned back to the caller.

{ action=android.app.action.GET_CONTENT type=vnd.android.cursor.item/vnd.google.note } is similar to the pick action, but allows the caller to specify the kind of data they want back so that the system can find the appropriate activity to pick something of that data type.

The second activity, com.android.notepad.NoteEditor, shows the user a single note entry and allows them to edit it. It can do two things as described by its two intent templates:

  1. xml Example

     <intent-filter android:label="@string/resolve_edit">
         <action android:name="android.intent.action.VIEW" />
         <action android:name="android.intent.action.EDIT" />
         <category android:name="android.intent.category.DEFAULT" />
         <data android:mimeType="vnd.android.cursor.item/vnd.google.note" />
     </intent-filter>
  2. xml Example

     <intent-filter>
         <action android:name="android.intent.action.INSERT" />
         <category android:name="android.intent.category.DEFAULT" />
         <data android:mimeType="vnd.android.cursor.dir/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.

The secondary use of this activity is to insert a new note entry into an existing directory of notes. This is used when the user creates a new note: the INSERT action is executed on the directory of notes, causing this activity to run and have the user create the new note data which it then adds to the content provider.

Given these capabilities, the following intents will resolve to the NoteEditor activity:

{ action=android.intent.action.VIEW data=content://com.google.provider.NotePad/notes/{ID} } shows the user the content of note {ID}.

{ action=android.app.action.EDIT data=content://com.google.provider.NotePad/notes/{ID} } allows the user to edit the content of note {ID}.

{ action=android.app.action.INSERT data=content://com.google.provider.NotePad/notes } creates a new, empty note in the notes list at "content://com.google.provider.NotePad/notes" and allows the user to edit it. If they keep their changes, the URI of the newly created note is returned to the caller.

The last activity, com.android.notepad.TitleEditor, allows the user to edit the title of a note. This could be implemented as a class that the application directly invokes (by explicitly setting its component in the Intent), but here we show a way you can publish alternative operations on existing data:

xml Example

 <intent-filter android:label="@string/resolve_title">
     <action android:name="com.android.notepad.action.EDIT_TITLE" />
     <category android:name="android.intent.category.DEFAULT" />
     <category android:name="android.intent.category.ALTERNATIVE" />
     <category android:name="android.intent.category.SELECTED_ALTERNATIVE" />
     <data android:mimeType="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(ComponentName,Intent[],Intent[],Intent[]) method, or more often to build dynamic menu items with Android.Views.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:

{ action=com.android.notepad.action.EDIT_TITLE data=content://com.google.provider.NotePad/notes/{ID} } displays and allows the user to edit the title associated with note {ID}.

Standard Activity Actions

These are the current standard actions that Intent defines for launching activities (usually through Context.StartActivity(Intent). The most important, and by far most frequently used, are Intent.ActionMain and Intent.ActionEdit.

Standard Broadcast Actions

These are the current standard actions that Intent defines for receiving broadcasts (usually through Context.RegisterReceiver(BroadcastReceiver,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 Intent.AddCategory(String).

Standard Extra Data

These are the current standard fields that can be used as extra data via Intent.PutExtra(String,Bundle).

Flags

These are the possible flags that can be used in the Intent via Intent.SetFlags(ActivityFlags) and Intent.AddFlags(ActivityFlags). See Intent.SetFlags(ActivityFlags) for a list of all possible flags.

[Android Documentation]

Requirements

Namespace: Android.Content
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.Content.Intent are listed below.

See Also: Object

Public Constructors

Create an empty intent.
Copy constructor.
Create an intent with a given action.
Create an intent with a given action and for a given data url.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Fields

const
ActionAirplaneModeChangedString.
const
ActionAllAppsString. Activity Action: List all available applications
const
ActionAnswerString. Activity Action: Handle an incoming phone call.
const
ActionAppErrorString. Activity Action: The user pressed the "Report" button in the crash/ANR dialog.
const
ActionApplicationRestrictionsChangedString. Broadcast Action: Sent after application restrictions are changed.
const
ActionAssistString. Activity Action: Perform assist action.
const
ActionAttachDataString. Used to indicate that some piece of data should be attached to some other place.
const
ActionBatteryChangedString. Broadcast Action: This is a sticky broadcast containing the charging state, level, and other information about the battery.
const
ActionBatteryLowString. Broadcast Action: Indicates low battery condition on the device.
const
ActionBatteryOkayString. Broadcast Action: Indicates the battery is now okay after being low.
const
ActionBootCompletedString. Broadcast Action: This is broadcast once, after the system has finished booting.
const
ActionBugReportString. Activity Action: Show activity for reporting a bug.
const
ActionCallString. Activity Action: Perform a call to someone specified by the data.
const
ActionCallButtonString. Activity Action: The user pressed the "call" button to go to the dialer or other appropriate UI for placing a call.
const
ActionCameraButtonString. Broadcast Action: The "Camera Button" was pressed.
const
ActionChooserString. Activity Action: Display an activity chooser, allowing the user to pick what they want to before proceeding.
const
ActionCloseSystemDialogsString. Broadcast Action: This is broadcast when a user action should request a temporary system dialog to dismiss.
const
ActionConfigurationChangedString. Broadcast Action: The current device Configuration (orientation, locale, etc) has changed.
const
ActionCreateDocumentString. Activity Action: Allow the user to create a new document.
const
ActionCreateShortcutString. Activity Action: Creates a shortcut.
const
ActionDateChangedString. Broadcast Action: The date has changed.
const
ActionDefaultString. A synonym for Intent.ActionView, the "standard" action that is performed on a piece of data.
const
ActionDeleteString. Activity Action: Delete the given data from its container.
const
ActionDeviceStorageLowString. Broadcast Action: A sticky broadcast that indicates low memory condition on the device
const
ActionDeviceStorageOkString. Broadcast Action: Indicates low memory condition on the device no longer exists
const
ActionDialString. Activity Action: Dial a number as specified by the data.
const
ActionDockEventString. Broadcast Action: A sticky broadcast for changes in the physical docking state of the device.
const
ActionDreamingStartedString. Broadcast Action: Sent after the system starts dreaming.
const
ActionDreamingStoppedString. Broadcast Action: Sent after the system stops dreaming.
const
ActionEditString. Activity Action: Provide explicit editable access to the given data.
const
ActionExternalApplicationsAvailableString. Broadcast Action: Resources for a set of packages (which were previously unavailable) are currently available since the media on which they exist is available.
const
ActionExternalApplicationsUnavailableString. Broadcast Action: Resources for a set of packages are currently unavailable since the media on which they exist is unavailable.
const
ActionFactoryTestString. Activity Action: Main entry point for factory tests.
const
ActionGetContentString. Activity Action: Allow the user to select a particular kind of data and return it.
const
ActionGetRestrictionEntriesString. Broadcast to a specific application to query any supported restrictions to impose on restricted users.
const
ActionGtalkServiceConnectedString. Broadcast Action: A GTalk connection has been established.
const
ActionGtalkServiceDisconnectedString. Broadcast Action: A GTalk connection has been disconnected.
const
ActionHeadsetPlugString. Broadcast Action: Wired Headset plugged in or unplugged.
const
ActionInputMethodChangedString. Broadcast Action: An input method has been changed.
const
ActionInsertString. Activity Action: Insert an empty item into the given container.
const
ActionInsertOrEditString. Activity Action: Pick an existing item, or insert a new item, and then edit it.
const
ActionInstallPackageString. Activity Action: Launch application installer.
const
ActionLocaleChangedString. Broadcast Action: The current device's locale has changed.
const
ActionMainString. Activity Action: Start as a main entry point, does not expect to receive data.
const
ActionManagedProfileAddedString. Broadcast sent to the primary user when an associated managed profile is added (the profile was created and is ready to be used).
const
ActionManagedProfileRemovedString. Broadcast sent to the primary user when an associated managed profile is removed.
const
ActionManageNetworkUsageString. Activity Action: Show settings for managing network data usage of a specific application.
const
ActionManagePackageStorageString. Broadcast Action: Indicates low memory condition notification acknowledged by user and package management should be started.
const
ActionMediaBadRemovalString. Broadcast Action: External media was removed from SD card slot, but mount point was not unmounted.
const
ActionMediaButtonString. Broadcast Action: The "Media Button" was pressed.
const
ActionMediaCheckingString. Broadcast Action: External media is present, and being disk-checked The path to the mount point for the checking media is contained in the Intent.mData field.
const
ActionMediaEjectString. Broadcast Action: User has expressed the desire to remove the external storage media.
const
ActionMediaMountedString. Broadcast Action: External media is present and mounted at its mount point.
const
ActionMediaNofsString. Broadcast Action: External media is present, but is using an incompatible fs (or is blank) The path to the mount point for the checking media is contained in the Intent.mData field.
const
ActionMediaRemovedString. Broadcast Action: External media has been removed.
const
ActionMediaScannerFinishedString. Broadcast Action: The media scanner has finished scanning a directory.
const
ActionMediaScannerScanFileString. Broadcast Action: Request the media scanner to scan a file and add it to the media database.
const
ActionMediaScannerStartedString. Broadcast Action: The media scanner has started scanning a directory.
const
ActionMediaSharedString. Broadcast Action: External media is unmounted because it is being shared via USB mass storage.
const
ActionMediaUnmountableString. Broadcast Action: External media is present but cannot be mounted.
const
ActionMediaUnmountedString. Broadcast Action: External media is present, but not mounted at its mount point.
const
ActionMyPackageReplacedString. Broadcast Action: A new version of your application has been installed over an existing one.
const
ActionNewOutgoingCallString. Broadcast Action: An outgoing call is about to be placed.
const
ActionOpenDocumentString. Activity Action: Allow the user to select and return one or more existing documents.
const
ActionOpenDocumentTreeString. Activity Action: Allow the user to pick a directory subtree.
const
ActionPackageAddedString. Broadcast Action: A new application package has been installed on the device.
const
ActionPackageChangedString. Broadcast Action: An existing application package has been changed (e.g. a component has been enabled or disabled).
const
ActionPackageDataClearedString. Broadcast Action: The user has cleared the data of a package.
const
ActionPackageFirstLaunchString. Broadcast Action: Sent to the installer package of an application when that application is first launched (that is the first time it is moved out of the stopped state).
const
ActionPackageFullyRemovedString. Broadcast Action: An existing application package has been completely removed from the device.
const
ActionPackageInstallString. Broadcast Action: Trigger the download and eventual installation of a package.
const
ActionPackageNeedsVerificationString. Broadcast Action: Sent to the system package verifier when a package needs to be verified.
const
ActionPackageRemovedString. Broadcast Action: An existing application package has been removed from the device.
const
ActionPackageReplacedString. Broadcast Action: A new version of an application package has been installed, replacing an existing version that was previously installed.
const
ActionPackageRestartedString. Broadcast Action: The user has restarted a package, and all of its processes have been killed.
const
ActionPackageVerifiedString. Broadcast Action: Sent to the system package verifier when a package is verified.
const
ActionPasteString. Activity Action: Create a new item in the given container, initializing it from the current contents of the clipboard.
const
ActionPickString. Activity Action: Pick an item from the data, returning what was selected.
const
ActionPickActivityString. Activity Action: Pick an activity given an intent, returning the class selected.
const
ActionPowerConnectedString. Broadcast Action: External power has been connected to the device.
const
ActionPowerDisconnectedString. Broadcast Action: External power has been removed from the device.
const
ActionPowerUsageSummaryString. Activity Action: Show power usage information to the user.
const
ActionProviderChangedString. 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.
const
ActionQuickClockString. Sent when the user taps on the clock widget in the system's "quick settings" area.
const
ActionRebootString. Broadcast Action: Have the device reboot.
const
ActionRunString. Activity Action: Run the data, whatever that means.
const
ActionScreenOffString. Broadcast Action: Sent when the device goes to sleep and becomes non-interactive.
const
ActionScreenOnString. Broadcast Action: Sent when the device wakes up and becomes interactive.
const
ActionSearchString. Activity Action: Perform a search.
const
ActionSearchLongPressString. Activity Action: Start action associated with long pressing on the search key.
const
ActionSendString. Activity Action: Deliver some data to someone else.
const
ActionSendMultipleString. Activity Action: Deliver multiple data to someone else.
const
ActionSendtoString. Activity Action: Send a message to someone specified by the data.
const
ActionSetWallpaperString. Activity Action: Show settings for choosing wallpaper
const
ActionShutdownString. Broadcast Action: Device is shutting down.
const
ActionSyncString. Activity Action: Perform a data synchronization.
const
ActionSystemTutorialString. Activity Action: Start the platform-defined tutorial
const
ActionTimeChangedString. Broadcast Action: The time was set.
const
ActionTimeTickString. Broadcast Action: The current time has changed.
const
ActionTimezoneChangedString. Broadcast Action: The timezone has changed.
const
ActionUidRemovedString. Broadcast Action: A user ID has been removed from the system.
const
ActionUmsConnectedString. Broadcast Action: The device has entered USB Mass Storage mode.
const
ActionUmsDisconnectedString. Broadcast Action: The device has exited USB Mass Storage mode.
const
ActionUninstallPackageString. Activity Action: Launch application uninstaller.
const
ActionUserBackgroundString. Sent when a user switch is happening, causing the process's user to be sent to the background.
const
ActionUserForegroundString. Sent when a user switch is happening, causing the process's user to be brought to the foreground.
const
ActionUserInitializeString. Sent the first time a user is starting, to allow system apps to perform one time initialization.
const
ActionUserPresentString. Broadcast Action: Sent when the user is present after device wakes up (e.g when the keyguard is gone).
const
ActionViewString. Activity Action: Display the data to the user.
const
ActionVoiceCommandString. Activity Action: Start Voice Command.
const
ActionWallpaperChangedString. Broadcast Action: The current system wallpaper has changed.
const
ActionWebSearchString. Activity Action: Perform a web search.
const
CategoryAlternativeString. Set if the activity should be considered as an alternative action to the data the user is currently viewing.
const
CategoryAppBrowserString. Used with Intent.ActionMain to launch the browser application.
const
CategoryAppCalculatorString. Used with Intent.ActionMain to launch the calculator application.
const
CategoryAppCalendarString. Used with Intent.ActionMain to launch the calendar application.
const
CategoryAppContactsString. Used with Intent.ActionMain to launch the contacts application.
const
CategoryAppEmailString. Used with Intent.ActionMain to launch the email application.
const
CategoryAppGalleryString. Used with Intent.ActionMain to launch the gallery application.
const
CategoryAppMapsString. Used with Intent.ActionMain to launch the maps application.
const
CategoryAppMarketString. This activity allows the user to browse and download new applications.
const
CategoryAppMessagingString. Used with Intent.ActionMain to launch the messaging application.
const
CategoryAppMusicString. Used with Intent.ActionMain to launch the music application.
const
CategoryBrowsableString. Activities that can be safely invoked from a browser must support this category.
const
CategoryCarDockString. An activity to run when device is inserted into a car dock.
const
CategoryCarModeString. Used to indicate that the activity can be used in a car environment.
const
CategoryDefaultString. Set if the activity should be an option for the default action (center press) to perform on a piece of data.
const
CategoryDeskDockString. An activity to run when device is inserted into a car dock.
const
CategoryDevelopmentPreferenceString. This activity is a development preference panel.
const
CategoryEmbedString. Capable of running inside a parent activity container.
const
CategoryFrameworkInstrumentationTestString. To be used as code under test for framework instrumentation tests.
const
CategoryHeDeskDockString. An activity to run when device is inserted into a digital (high end) dock.
const
CategoryHomeString. This is the home activity, that is the first activity that is displayed when the device boots.
const
CategoryInfoString. Provides information about the package it is in; typically used if a package does not contain a Intent.CategoryLauncher to provide a front-door to the user without having to be shown in the all apps list.
const
CategoryLauncherString. Should be displayed in the top-level launcher.
const
CategoryLeanbackLauncherString. Indicates an activity optimized for Leanback mode, and that should be displayed in the Leanback launcher.
const
CategoryLeDeskDockString. An activity to run when device is inserted into a analog (low end) dock.
const
CategoryMonkeyString. This activity may be exercised by the monkey or other automated test tools.
const
CategoryOpenableString. Used to indicate that an intent only wants URIs that can be opened with ContentResolver.OpenFileDescriptor(Uri,String).
const
CategoryPreferenceString. This activity is a preference panel.
const
CategorySampleCodeString. To be used as a sample code example (not part of the normal user experience).
const
CategorySelectedAlternativeString. Set if the activity should be considered as an alternative selection action to the data the user has currently selected.
const
CategoryTabString. Intended to be used as a tab inside of a containing TabActivity.
const
CategoryTestString. To be used as a test (not part of the normal user experience).
const
CategoryUnitTestString. To be used as a unit test (run through the Test Harness).
const
ExtraAlarmCountString. 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.
const
ExtraAllowMultipleString. Extra used to indicate that an intent can allow the user to select and return multiple items.
const
ExtraAllowReplaceString. Used as a boolean extra field with Intent.ActionInstallPackage to install a package.
const
ExtraAssistContextString. An optional field on Intent.ActionAssist and containing additional contextual information supplied by the current foreground app at the time of the assist request.
const
ExtraAssistInputHintKeyboardString. An optional field on Intent.ActionAssist suggesting that the user will likely use a keyboard as the primary input device for assistance.
const
ExtraAssistPackageString. An optional field on Intent.ActionAssist containing the name of the current foreground application package at the time the assist was invoked.
const
ExtraBccString. A String[] holding e-mail addresses that should be blind carbon copied.
const
ExtraBugReportString. Used as a parcelable extra field in Intent.ActionAppError, containing the bug report.
const
ExtraCcString. A String[] holding e-mail addresses that should be carbon copied.
const
ExtraChangedComponentNameString.
const
ExtraChangedComponentNameListString. This field is part of Intent.ActionPackageChanged, and contains a string array of all of the components that have changed.
const
ExtraChangedPackageListString. This field is part of Intent.ActionExternalApplicationsAvailable, Intent.ActionExternalApplicationsUnavailable and contains a string array of all of the components that have changed.
const
ExtraChangedUidListString. This field is part of Intent.ActionExternalApplicationsAvailable, Intent.ActionExternalApplicationsUnavailable and contains an integer array of uids of all of the components that have changed.
const
ExtraDataRemovedString. Used as a boolean extra field in Intent.ActionPackageRemoved intents to indicate whether this represents a full uninstall (removing both the code and its data) or a partial uninstall (leaving its data, implying that this is an update).
const
ExtraDockStateString. Used as an int extra field in Intent.ActionDockEvent intents to request the dock state.
const
ExtraDontKillAppString. Used as a boolean extra field in Intent.ActionPackageRemoved or Intent.ActionPackageChanged intents to override the default action of restarting the application.
const
ExtraEmailString. A String[] holding e-mail addresses that should be delivered to.
const
ExtraHtmlTextString. A constant String that is associated with the Intent, used with Intent.ActionSend to supply an alternative to Intent.ExtraText as HTML formatted text.
const
ExtraInitialIntentsString. A Parcelable[] of Intent or LabeledIntent objects as set with Intent.PutExtra(String,IParcelable[]) of additional activities to place a the front of the list of choices, when shown to the user with a Intent.ActionChooser.
const
ExtraInstallerPackageNameString. Used as a string extra field with Intent.ActionInstallPackage to install a package.
const
ExtraIntentString. An Intent describing the choices you would like shown with Intent.ActionPickActivity or Intent.ActionChooser.
const
ExtraKeyEventString. A KeyEvent object containing the event that triggered the creation of the Intent it is in.
const
ExtraLocalOnlyString. Extra used to indicate that an intent should only return data that is on the local device.
const
ExtraMimeTypesString. Extra used to communicate a set of acceptable MIME types.
const
ExtraNotUnknownSourceString. Used as a boolean extra field with Intent.ActionInstallPackage to install a package.
const
ExtraOriginatingUriString. Used as a URI extra field with Intent.ActionInstallPackage and Intent.ActionView to indicate the URI from which the local APK in the Intent data field originated from.
const
ExtraPhoneNumberString. A String holding the phone number originally entered in Intent.ActionNewOutgoingCall, or the actual number to call in a Intent.ActionCall.
const
ExtraReferrerString. This extra can be used with any Intent used to launch an activity, supplying information about who is launching that activity.
const
ExtraRemoteIntentTokenString. Used in the extra field in the remote intent.
const
ExtraReplacementExtrasString. A Bundle forming a mapping of potential target package names to different extras Bundles to add to the default intent extras in Intent.ExtraIntent when used with Intent.ActionChooser.
const
ExtraReplacingString. Used as a boolean extra field in Intent.ActionPackageRemoved intents to indicate that this is a replacement of the package, so this broadcast will immediately be followed by an add broadcast for a different version of the same package.
const
ExtraRestrictionsBundleString. Extra sent in the intent to the BroadcastReceiver that handles Intent.ActionGetRestrictionEntries.
const
ExtraRestrictionsIntentString. Extra used in the response from a BroadcastReceiver that handles Intent.ActionGetRestrictionEntries.
const
ExtraRestrictionsListString. Extra used in the response from a BroadcastReceiver that handles Intent.ActionGetRestrictionEntries.
const
ExtraReturnResultString. Used as a boolean extra field with Intent.ActionInstallPackage or Intent.ActionUninstallPackage.
const
ExtraShortcutIconString. The name of the extra used to define the icon, as a Bitmap, of a shortcut.
const
ExtraShortcutIconResourceString. The name of the extra used to define the icon, as a ShortcutIconResource, of a shortcut.
const
ExtraShortcutIntentString. The name of the extra used to define the Intent of a shortcut.
const
ExtraShortcutNameString. The name of the extra used to define the name of a shortcut.
const
ExtraShutdownUserspaceOnlyString. Optional extra for Intent.ActionShutdown that allows the sender to qualify that this shutdown is only for the user space of the system, not a complete shutdown.
const
ExtraStreamString. A content: URI holding a stream of data associated with the Intent, used with Intent.ActionSend to supply the data being sent.
const
ExtraSubjectString. A constant string holding the desired subject line of a message.
const
ExtraTemplateString. The initial data to place in a newly created record.
const
ExtraTextString. A constant CharSequence that is associated with the Intent, used with Intent.ActionSend to supply the literal data to be sent.
const
ExtraTitleString. A CharSequence dialog title to provide to the user when used with a Intent.ActionChooser.
const
ExtraUidString. Used as an int extra field in Intent.ActionUidRemoved intents to supply the uid the package had been assigned.
const
ExtraUserString. The UserHandle carried with broadcasts intents related to addition and removal of managed profiles - Intent.ActionManagedProfileAdded and Intent.ActionManagedProfileRemoved.
const
MetadataDockHomeString. Boolean that can be supplied as meta-data with a dock activity, to indicate that the dock should take over the home key when it is active.
const
UriIntentSchemeIntentUriType (1). Flag for use with Intent.ToUri(IntentUriType) and Intent.ParseUri(String,IntentUriType): the URI string always has the "intent:" scheme.

Public Properties

[read-only]
ActionString. Retrieve the general action to be performed, such as Intent.ActionView.
[read-only]
CategoriesICollection<string>. Return the set of all categories in the intent.
ClipDataClipData. Return the ClipData associated with this Intent.
[read-only]
ComponentComponentName. Retrieve the concrete component associated with the intent.
[read-only]
static
CreatorIParcelableCreator.
[read-only]
DataUri. Retrieve data this intent is operating on.
[read-only]
DataStringString. The same as Intent.Data, but returns the URI as an encoded String.
[read-only]
ExtrasBundle. Retrieves a map of extended data from the intent.
[read-only]
FlagsActivityFlags. Retrieve any special flags associated with this intent.
[read-only]
HasFileDescriptorsBoolean. Returns true if the Intent's extras contain a parcelled file descriptor.
[read-only]
PackageString. Retrieve the application package name this Intent is limited to.
[read-only]
SchemeString. Return the scheme portion of the intent's data.
SelectorIntent. Return the specific selector associated with this Intent.
SourceBoundsRect. Get the bounds of the sender of this intent, in screen coordinates.
[read-only]
TypeString. Retrieve any explicit MIME type included in the intent.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

AddCategory(String) : Intent
Add a new category to the intent.
AddFlags(ActivityFlags) : Intent
Add additional flags to the intent (or with existing flags value).
Clone() : Object
Creates and returns a copy of this Object.
CloneFilter() : Intent
Make a clone of only the parts of the Intent that are relevant for filter matching: the action, data, type, component, and categories.
static
CreateChooser(Intent, ICharSequence) : Intent
Convenience function for creating a Intent.ActionChooser Intent.
static
CreateChooser(Intent, String) : Intent
DescribeContents() : Int32
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
FillIn(Intent, FillInFlags) : FillInFlags
Copy the contents of other in to this object, but only where fields are not defined by this object.
FilterEquals(Intent) : Boolean
Determine if two intents are the same for the purposes of intent resolution (filtering).
FilterHashCode() : Int32
Generate hash code that matches semantics of filterEquals().
GetBooleanArrayExtra(String) : Boolean[]
Retrieve extended data from the intent.
GetBooleanExtra(String, Boolean) : Boolean
Retrieve extended data from the intent.
GetBundleExtra(String) : Bundle
Retrieve extended data from the intent.
GetByteArrayExtra(String) : Byte[]
Retrieve extended data from the intent.
GetByteExtra(String, SByte) : SByte
Retrieve extended data from the intent.
GetCharArrayExtra(String) : Char[]
Retrieve extended data from the intent.
GetCharExtra(String, Char) : Char
Retrieve extended data from the intent.
GetCharSequenceArrayExtra(String) : String[]
GetCharSequenceArrayExtraFormatted(String) : ICharSequence[]
Retrieve extended data from the intent.
GetCharSequenceArrayListExtra(String) : IList<Java.Lang.ICharSequence>
Retrieve extended data from the intent.
GetCharSequenceExtra(String) : String
GetCharSequenceExtraFormatted(String) : ICharSequence
Retrieve extended data from the intent.
GetDoubleArrayExtra(String) : Double[]
Retrieve extended data from the intent.
GetDoubleExtra(String, Double) : Double
Retrieve extended data from the intent.
GetFloatArrayExtra(String) : Single[]
Retrieve extended data from the intent.
GetFloatExtra(String, Single) : Single
Retrieve extended data from the intent.
GetIntArrayExtra(String) : Int32[]
Retrieve extended data from the intent.
GetIntegerArrayListExtra(String) : IList<Java.Lang.Integer>
Retrieve extended data from the intent.
static
GetIntent(String) : Intent
Call Intent.ParseUri(String,IntentUriType) with 0 flags.
static
GetIntentOld(String) : Intent
GetIntExtra(String, Int32) : Int32
Retrieve extended data from the intent.
GetLongArrayExtra(String) : Int64[]
Retrieve extended data from the intent.
GetLongExtra(String, Int64) : Int64
Retrieve extended data from the intent.
GetParcelableArrayExtra(String) : IParcelable[]
Retrieve extended data from the intent.
GetParcelableArrayListExtra(String) : IList
Retrieve extended data from the intent.
GetParcelableExtra(String) : Object
Retrieve extended data from the intent.
GetSerializableExtra(String) : ISerializable
Retrieve extended data from the intent.
GetShortArrayExtra(String) : Int16[]
Retrieve extended data from the intent.
GetShortExtra(String, Int16) : Int16
Retrieve extended data from the intent.
GetStringArrayExtra(String) : String[]
Retrieve extended data from the intent.
GetStringArrayListExtra(String) : IList<string>
Retrieve extended data from the intent.
GetStringExtra(String) : String
Retrieve extended data from the intent.
HasCategory(String) : Boolean
Check if a category exists in the intent.
HasExtra(String) : Boolean
Returns true if an extra value is associated with the given name.
static
MakeMainActivity(ComponentName) : Intent
Create an intent to launch the main (root) activity of a task.
static
MakeMainSelectorActivity(String, String) : Intent
Make an Intent for the main activity of an application, without specifying a specific activity to run but giving a selector to find the activity.
static
MakeRestartActivityTask(ComponentName) : Intent
Make an Intent that can be used to re-launch an application's task in its base state.
static
NormalizeMimeType(String) : String
Normalize a MIME data type.
static
ParseIntent(Resources, XmlReader, IAttributeSet) : Intent
Parses the "intent" element (and its children) from XML and instantiates an Intent object.
static
ParseUri(String, IntentUriType) : Intent
Create an intent from a URI.
PutCharSequenceArrayListExtra(String, IList<Java.Lang.ICharSequence>) : Intent
PutExtra(String, Bundle) : Intent
Add extended data to the intent.
PutExtra(String, IParcelable) : Intent
Add extended data to the intent.
PutExtra(String, IParcelable[]) : Intent
Add extended data to the intent.
PutExtra(String, ISerializable) : Intent
Add extended data to the intent.
PutExtra(String, ICharSequence) : Intent
Add extended data to the intent.
PutExtra(String, ICharSequence[]) : Intent
Add extended data to the intent.
PutExtra(String, Boolean) : Intent
Add extended data to the intent.
PutExtra(String, Boolean[]) : Intent
Add extended data to the intent.
PutExtra(String, Byte[]) : Intent
Add extended data to the intent.
PutExtra(String, Char) : Intent
Add extended data to the intent.
PutExtra(String, Char[]) : Intent
Add extended data to the intent.
PutExtra(String, Double) : Intent
Add extended data to the intent.
PutExtra(String, Double[]) : Intent
Add extended data to the intent.
PutExtra(String, Int16) : Intent
Add extended data to the intent.
PutExtra(String, Int16[]) : Intent
Add extended data to the intent.
PutExtra(String, Int32) : Intent
Add extended data to the intent.
PutExtra(String, Int32[]) : Intent
Add extended data to the intent.
PutExtra(String, Int64) : Intent
Add extended data to the intent.
PutExtra(String, Int64[]) : Intent
Add extended data to the intent.
PutExtra(String, SByte) : Intent
Add extended data to the intent.
PutExtra(String, Single) : Intent
Add extended data to the intent.
PutExtra(String, Single[]) : Intent
Add extended data to the intent.
PutExtra(String, String) : Intent
Add extended data to the intent.
PutExtra(String, String[]) : Intent
Add extended data to the intent.
PutExtras(Intent) : Intent
Copy all extras in 'src' in to this intent.
PutExtras(Bundle) : Intent
Add a set of extended data to the intent.
PutIntegerArrayListExtra(String, IList<Java.Lang.Integer>) : Intent
PutParcelableArrayListExtra(String, IList<Android.OS.IParcelable>) : Intent
PutStringArrayListExtra(String, IList<string>) : Intent
ReadFromParcel(Parcel)
RemoveCategory(String)
Remove a category from an intent.
RemoveExtra(String)
Remove extended data from the intent.
ReplaceExtras(Intent) : Intent
Completely replace the extras in the Intent with the extras in the given Intent.
ReplaceExtras(Bundle) : Intent
Completely replace the extras in the Intent with the given Bundle of extras.
ResolveActivity(PackageManager) : ComponentName
Return the Activity component that should be used to handle this intent.
ResolveActivityInfo(PackageManager, PackageInfoFlags) : ActivityInfo
Resolve the Intent into an ActivityInfo describing the activity that should execute the intent.
ResolveType(ContentResolver) : String
Return the MIME data type of this intent.
ResolveType(Context) : String
Return the MIME data type of this intent.
ResolveTypeIfNeeded(ContentResolver) : String
Return the MIME data type of this intent, only if it will be needed for intent resolution.
SetAction(String) : Intent
Set the general action to be performed.
SetClass(Context, Class) : Intent
SetClass(Context, Type) : Intent
SetClassName(Context, String) : Intent
Convenience for calling Intent.SetComponent(ComponentName) with an explicit class name.
SetClassName(String, String) : Intent
Convenience for calling Intent.SetComponent(ComponentName) with an explicit application package name and class name.
SetComponent(ComponentName) : Intent
(Usually optional) Explicitly set the component to handle the intent.
SetData(Uri) : Intent
Set the data this intent is operating on.
SetDataAndNormalize(Uri) : Intent
Normalize and set the data this intent is operating on.
SetDataAndType(Uri, String) : Intent
(Usually optional) Set the data for the intent along with an explicit MIME data type.
SetDataAndTypeAndNormalize(Uri, String) : Intent
(Usually optional) Normalize and set both the data Uri and an explicit MIME data type.
SetExtrasClassLoader(ClassLoader)
Sets the ClassLoader that will be used when unmarshalling any Parcelable values from the extras of this Intent.
SetFlags(ActivityFlags) : Intent
Set special flags controlling how this intent is handled.
SetPackage(String) : Intent
(Usually optional) Set an explicit application package name that limits the components this Intent will resolve to.
SetType(String) : Intent
Set an explicit MIME data type.
SetTypeAndNormalize(String) : Intent
Normalize and set an explicit MIME data type.
ToUri(IntentUriType) : String
Convert this Intent into a String holding a URI representation of it.
ToURI() : String
Call Intent.ToUri(IntentUriType) with 0 flags.
WriteToParcel(Parcel, ParcelableWriteFlags)
Flatten this object in to a Parcel.