PendingIntent.GetActivities Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| GetActivities(Context, Int32, Intent[], PendingIntentFlags, Bundle) |
Like getActivity(Context,int,Intent,int), but allows an array of Intents to be supplied. |
| GetActivities(Context, Int32, Intent[], PendingIntentFlags) |
Like getActivity(Context,int,Intent,int), but allows an array of Intents to be supplied. |
GetActivities(Context, Int32, Intent[], PendingIntentFlags, Bundle)
Like getActivity(Context,int,Intent,int), but allows an array of Intents to be supplied.
[Android.Runtime.Register("getActivities", "(Landroid/content/Context;I[Landroid/content/Intent;ILandroid/os/Bundle;)Landroid/app/PendingIntent;", "")]
public static Android.App.PendingIntent? GetActivities(Android.Content.Context? context, int requestCode, Android.Content.Intent[] intents, Android.App.PendingIntentFlags flags, Android.OS.Bundle? options);
[<Android.Runtime.Register("getActivities", "(Landroid/content/Context;I[Landroid/content/Intent;ILandroid/os/Bundle;)Landroid/app/PendingIntent;", "")>]
static member GetActivities : Android.Content.Context * int * Android.Content.Intent[] * Android.App.PendingIntentFlags * Android.OS.Bundle -> Android.App.PendingIntent
Parameters
- context
- Context
Context: The Context in which this PendingIntent should start the activity.
- requestCode
- Int32
int: Private request code for the sender
- intents
- Intent[]
Intent: Array of Intents of the activities to be launched. This value cannot be null.
- flags
- PendingIntentFlags
int: May be FLAG_ONE_SHOT, FLAG_NO_CREATE, FLAG_CANCEL_CURRENT, FLAG_UPDATE_CURRENT, FLAG_IMMUTABLE or any of the flags as supported by Intent.fillIn() to control which unspecified parts of the intent that can be supplied when the actual send happens. Value is either 0 or a combination of the following: FLAG_ONE_SHOT FLAG_NO_CREATE FLAG_CANCEL_CURRENT FLAG_UPDATE_CURRENT FLAG_IMMUTABLE FLAG_MUTABLE FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT Intent.FILL_IN_ACTION Intent.FILL_IN_DATA Intent.FILL_IN_CATEGORIES Intent.FILL_IN_COMPONENT Intent.FILL_IN_PACKAGE Intent.FILL_IN_SOURCE_BOUNDS Intent.FILL_IN_SELECTOR Intent.FILL_IN_CLIP_DATA
- options
- Bundle
Bundle: This value may be null.
Returns
The PendingIntent for the requested operation, or null when FLAG_NO_CREATE is set and no matching PendingIntent exists.
- Attributes
Remarks
Like getActivity(Context,int,Intent,int), but allows an array of Intents to be supplied. The last Intent in the array is taken as the primary key for the PendingIntent, like the single Intent given to getActivity(Context,int,Intent,int). Upon sending the resulting PendingIntent, all of the Intents are started in the same way as they would be by passing them to Context.startActivities(Intent[]). The first intent in the array will be started outside of the context of an existing activity, so you must use the Intent.FLAG_ACTIVITY_NEW_TASK launch flag in the Intent. (Activities after the first in the array are started in the context of the previous activity in the array, so FLAG_ACTIVITY_NEW_TASK is not needed nor desired for them.)
The last intent in the array represents the key for the PendingIntent. In other words, it is the significant element for matching (as done with the single intent given to getActivity(Context,int,Intent,int), its content will be the subject of replacement by send(Context,int,Intent) and FLAG_UPDATE_CURRENT, etc. This is because it is the most specific of the supplied intents, and the UI the user actually sees when the intents are started.
For security reasons, the Intent objects you supply here should almost always be explicit intents, that is specify an explicit component to be delivered to through Intent.setClass
Android reference for android.app.PendingIntent.getActivities.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
GetActivities(Context, Int32, Intent[], PendingIntentFlags)
Like getActivity(Context,int,Intent,int), but allows an array of Intents to be supplied.
[Android.Runtime.Register("getActivities", "(Landroid/content/Context;I[Landroid/content/Intent;I)Landroid/app/PendingIntent;", "")]
public static Android.App.PendingIntent? GetActivities(Android.Content.Context? context, int requestCode, Android.Content.Intent[] intents, Android.App.PendingIntentFlags flags);
[<Android.Runtime.Register("getActivities", "(Landroid/content/Context;I[Landroid/content/Intent;I)Landroid/app/PendingIntent;", "")>]
static member GetActivities : Android.Content.Context * int * Android.Content.Intent[] * Android.App.PendingIntentFlags -> Android.App.PendingIntent
Parameters
- context
- Context
Context: The Context in which this PendingIntent should start the activity.
- requestCode
- Int32
int: Private request code for the sender
- intents
- Intent[]
Intent: Array of Intents of the activities to be launched. This value cannot be null.
- flags
- PendingIntentFlags
int: May be FLAG_ONE_SHOT, FLAG_NO_CREATE, FLAG_CANCEL_CURRENT, FLAG_UPDATE_CURRENT, or any of the flags as supported by Intent.fillIn() to control which unspecified parts of the intent that can be supplied when the actual send happens. Value is either 0 or a combination of the following: FLAG_ONE_SHOT FLAG_NO_CREATE FLAG_CANCEL_CURRENT FLAG_UPDATE_CURRENT FLAG_IMMUTABLE FLAG_MUTABLE FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT Intent.FILL_IN_ACTION Intent.FILL_IN_DATA Intent.FILL_IN_CATEGORIES Intent.FILL_IN_COMPONENT Intent.FILL_IN_PACKAGE Intent.FILL_IN_SOURCE_BOUNDS Intent.FILL_IN_SELECTOR Intent.FILL_IN_CLIP_DATA
Returns
The PendingIntent for the requested operation, or null when FLAG_NO_CREATE is set and no matching PendingIntent exists.
- Attributes
Remarks
Like getActivity(Context,int,Intent,int), but allows an array of Intents to be supplied. The last Intent in the array is taken as the primary key for the PendingIntent, like the single Intent given to getActivity(Context,int,Intent,int). Upon sending the resulting PendingIntent, all of the Intents are started in the same way as they would be by passing them to Context.startActivities(Intent[]). The first intent in the array will be started outside of the context of an existing activity, so you must use the Intent.FLAG_ACTIVITY_NEW_TASK launch flag in the Intent. (Activities after the first in the array are started in the context of the previous activity in the array, so FLAG_ACTIVITY_NEW_TASK is not needed nor desired for them.)
The last intent in the array represents the key for the PendingIntent. In other words, it is the significant element for matching (as done with the single intent given to getActivity(Context,int,Intent,int), its content will be the subject of replacement by send(Context,int,Intent) and FLAG_UPDATE_CURRENT, etc. This is because it is the most specific of the supplied intents, and the UI the user actually sees when the intents are started.
For security reasons, the Intent objects you supply here should almost always be explicit intents, that is specify an explicit component to be delivered to through Intent.setClass
Android reference for android.app.PendingIntent.getActivities.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.