Condividi tramite


Intent.CreateChooser Method

Definition

Overloads

CreateChooser(Intent, ICharSequence)

Convenience function for creating a #ACTION_CHOOSER Intent.

CreateChooser(Intent, String)

Convenience function for creating a #ACTION_CHOOSER Intent.

CreateChooser(Intent, ICharSequence, IntentSender)

Convenience function for creating a #ACTION_CHOOSER Intent.

CreateChooser(Intent, String, IntentSender)

Convenience function for creating a #ACTION_CHOOSER Intent.

CreateChooser(Intent, ICharSequence)

Convenience function for creating a #ACTION_CHOOSER Intent.

[Android.Runtime.Register("createChooser", "(Landroid/content/Intent;Ljava/lang/CharSequence;)Landroid/content/Intent;", "")]
public static Android.Content.Intent? CreateChooser (Android.Content.Intent? target, Java.Lang.ICharSequence? title);
[<Android.Runtime.Register("createChooser", "(Landroid/content/Intent;Ljava/lang/CharSequence;)Landroid/content/Intent;", "")>]
static member CreateChooser : Android.Content.Intent * Java.Lang.ICharSequence -> Android.Content.Intent

Parameters

target
Intent

The Intent that the user will be selecting an activity to perform.

title
ICharSequence

Optional title that will be displayed in the chooser, only when the target action is not ACTION_SEND or ACTION_SEND_MULTIPLE.

Returns

Return a new Intent object that you can hand to Context#startActivity(Intent) Context.startActivity() and related methods.

Attributes

Remarks

Convenience function for creating a #ACTION_CHOOSER Intent.

Builds a new #ACTION_CHOOSER Intent that wraps the given target intent, also optionally supplying a title. If the target intent has specified #FLAG_GRANT_READ_URI_PERMISSION or #FLAG_GRANT_WRITE_URI_PERMISSION, then these flags will also be set in the returned chooser intent, with its ClipData set appropriately: either a direct reflection of #getClipData() if that is non-null, or a new ClipData built from #getData().

Java documentation for android.content.Intent.createChooser(android.content.Intent, java.lang.CharSequence).

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

CreateChooser(Intent, String)

Convenience function for creating a #ACTION_CHOOSER Intent.

public static Android.Content.Intent? CreateChooser (Android.Content.Intent? target, string? title);
static member CreateChooser : Android.Content.Intent * string -> Android.Content.Intent

Parameters

target
Intent

The Intent that the user will be selecting an activity to perform.

title
String

Optional title that will be displayed in the chooser, only when the target action is not ACTION_SEND or ACTION_SEND_MULTIPLE.

Returns

Return a new Intent object that you can hand to Context#startActivity(Intent) Context.startActivity() and related methods.

Remarks

Convenience function for creating a #ACTION_CHOOSER Intent.

Builds a new #ACTION_CHOOSER Intent that wraps the given target intent, also optionally supplying a title. If the target intent has specified #FLAG_GRANT_READ_URI_PERMISSION or #FLAG_GRANT_WRITE_URI_PERMISSION, then these flags will also be set in the returned chooser intent, with its ClipData set appropriately: either a direct reflection of #getClipData() if that is non-null, or a new ClipData built from #getData().

Java documentation for android.content.Intent.createChooser(android.content.Intent, java.lang.CharSequence).

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

CreateChooser(Intent, ICharSequence, IntentSender)

Convenience function for creating a #ACTION_CHOOSER Intent.

[Android.Runtime.Register("createChooser", "(Landroid/content/Intent;Ljava/lang/CharSequence;Landroid/content/IntentSender;)Landroid/content/Intent;", "", ApiSince=22)]
public static Android.Content.Intent? CreateChooser (Android.Content.Intent? target, Java.Lang.ICharSequence? title, Android.Content.IntentSender? sender);
[<Android.Runtime.Register("createChooser", "(Landroid/content/Intent;Ljava/lang/CharSequence;Landroid/content/IntentSender;)Landroid/content/Intent;", "", ApiSince=22)>]
static member CreateChooser : Android.Content.Intent * Java.Lang.ICharSequence * Android.Content.IntentSender -> Android.Content.Intent

Parameters

target
Intent

The Intent that the user will be selecting an activity to perform.

title
ICharSequence

Optional title that will be displayed in the chooser, only when the target action is not ACTION_SEND or ACTION_SEND_MULTIPLE.

sender
IntentSender

Optional IntentSender to be called when a choice is made.

Returns

Return a new Intent object that you can hand to Context#startActivity(Intent) Context.startActivity() and related methods.

Attributes

Remarks

Convenience function for creating a #ACTION_CHOOSER Intent.

Builds a new #ACTION_CHOOSER Intent that wraps the given target intent, also optionally supplying a title. If the target intent has specified #FLAG_GRANT_READ_URI_PERMISSION or #FLAG_GRANT_WRITE_URI_PERMISSION, then these flags will also be set in the returned chooser intent, with its ClipData set appropriately: either a direct reflection of #getClipData() if that is non-null, or a new ClipData built from #getData().

The caller may optionally supply an IntentSender to receive a callback when the user makes a choice. This can be useful if the calling application wants to remember the last chosen target and surface it as a more prominent or one-touch affordance elsewhere in the UI for next time.

Java documentation for android.content.Intent.createChooser(android.content.Intent, java.lang.CharSequence, android.content.IntentSender).

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

CreateChooser(Intent, String, IntentSender)

Convenience function for creating a #ACTION_CHOOSER Intent.

public static Android.Content.Intent? CreateChooser (Android.Content.Intent? target, string? title, Android.Content.IntentSender? sender);
static member CreateChooser : Android.Content.Intent * string * Android.Content.IntentSender -> Android.Content.Intent

Parameters

target
Intent

The Intent that the user will be selecting an activity to perform.

title
String

Optional title that will be displayed in the chooser, only when the target action is not ACTION_SEND or ACTION_SEND_MULTIPLE.

sender
IntentSender

Optional IntentSender to be called when a choice is made.

Returns

Return a new Intent object that you can hand to Context#startActivity(Intent) Context.startActivity() and related methods.

Remarks

Convenience function for creating a #ACTION_CHOOSER Intent.

Builds a new #ACTION_CHOOSER Intent that wraps the given target intent, also optionally supplying a title. If the target intent has specified #FLAG_GRANT_READ_URI_PERMISSION or #FLAG_GRANT_WRITE_URI_PERMISSION, then these flags will also be set in the returned chooser intent, with its ClipData set appropriately: either a direct reflection of #getClipData() if that is non-null, or a new ClipData built from #getData().

The caller may optionally supply an IntentSender to receive a callback when the user makes a choice. This can be useful if the calling application wants to remember the last chosen target and surface it as a more prominent or one-touch affordance elsewhere in the UI for next time.

Java documentation for android.content.Intent.createChooser(android.content.Intent, java.lang.CharSequence, android.content.IntentSender).

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