Android.Content.Intent.ActionChooser Field
Activity Action: Display an activity chooser, allowing the user to pick what they want to before proceeding.

Syntax

[Android.Runtime.Register("ACTION_CHOOSER")]
public const string ActionChooser

Remarks

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:

  • You can specify the title that will appear in the activity chooser.
  • The user does not have the option to make one of the matching activities a preferred activity, and all possible activities will always be shown even if one of them is currently marked as the preferred activity.

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

If you need to grant URI permissions through a chooser, you must specify the permissions to be granted on the ACTION_CHOOSER Intent in addition to the EXTRA_INTENT inside. This means using Intent.ClipData to specify the URIs to be granted as well as Intent.FLAG_GRANT_READ_URI_PERMISSION and/or Intent.FLAG_GRANT_WRITE_URI_PERMISSION as appropriate.

As a convenience, an Intent of this form can be created with the Intent.CreateChooser(Intent, Java.Lang.ICharSequence) function.

Input: No data should be specified. get*Extra must have a Intent.ExtraIntent field containing the Intent being executed, and can optionally have a Intent.ExtraTitle field containing the title text to display in the chooser.

Output: Depends on the protocol of Intent.ExtraIntent.

[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