ChooserTarget Constructors

Definition

Overloads

ChooserTarget(ICharSequence, Icon, Single, ComponentName, Bundle)

Construct a deep link target for presentation by a chooser UI.

ChooserTarget(String, Icon, Single, ComponentName, Bundle)

ChooserTarget(ICharSequence, Icon, Single, ComponentName, Bundle)

Construct a deep link target for presentation by a chooser UI.

[Android.Runtime.Register(".ctor", "(Ljava/lang/CharSequence;Landroid/graphics/drawable/Icon;FLandroid/content/ComponentName;Landroid/os/Bundle;)V", "", ApiSince=23)]
public ChooserTarget (Java.Lang.ICharSequence? title, Android.Graphics.Drawables.Icon? icon, float score, Android.Content.ComponentName? componentName, Android.OS.Bundle? intentExtras);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/CharSequence;Landroid/graphics/drawable/Icon;FLandroid/content/ComponentName;Landroid/os/Bundle;)V", "", ApiSince=23)>]
new Android.Service.Chooser.ChooserTarget : Java.Lang.ICharSequence * Android.Graphics.Drawables.Icon * single * Android.Content.ComponentName * Android.OS.Bundle -> Android.Service.Chooser.ChooserTarget

Parameters

title
ICharSequence

title of this target that will be shown to a user

icon
Icon

icon to represent this target

score
Single

ranking score for this target between 0.0f and 1.0f, inclusive

componentName
ComponentName

Name of the component to be launched if this target is chosen

intentExtras
Bundle

Bundle of extras to merge with the extras of the launched intent

Attributes

Remarks

Construct a deep link target for presentation by a chooser UI.

A target is composed of a title and an icon for presentation to the user. The UI presenting this target may truncate the title if it is too long to be presented in the available space, as well as crop, resize or overlay the supplied icon.

The creator of a target may supply a ranking score. This score is assumed to be relative to the other targets supplied by the same ChooserTargetService#onGetChooserTargets(ComponentName, IntentFilter) query. Scores should be in the range from 0.0f (unlikely match) to 1.0f (very relevant match). Scores for a set of targets do not need to sum to 1.

The ComponentName must be the name of an Activity component in the creator's own package, or an exported component from any other package. You may provide an optional Bundle of extras that will be merged into the final intent before it is sent to the target Activity; use this to add any additional data about the deep link that the target activity will read. e.g. conversation IDs, email addresses, etc.

Take care not to place custom android.os.Parcelable types into the extras bundle, as the system will not be able to unparcel them to merge them.

Java documentation for android.service.chooser.ChooserTarget.ChooserTarget(java.lang.CharSequence, android.graphics.drawable.Icon, float, android.content.ComponentName, android.os.Bundle).

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

ChooserTarget(String, Icon, Single, ComponentName, Bundle)

[Android.Runtime.Register(".ctor", "(Ljava/lang/CharSequence;Landroid/graphics/drawable/Icon;FLandroid/content/ComponentName;Landroid/os/Bundle;)V", "", ApiSince=23)]
public ChooserTarget (string? title, Android.Graphics.Drawables.Icon? icon, float score, Android.Content.ComponentName? componentName, Android.OS.Bundle? intentExtras);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/CharSequence;Landroid/graphics/drawable/Icon;FLandroid/content/ComponentName;Landroid/os/Bundle;)V", "", ApiSince=23)>]
new Android.Service.Chooser.ChooserTarget : string * Android.Graphics.Drawables.Icon * single * Android.Content.ComponentName * Android.OS.Bundle -> Android.Service.Chooser.ChooserTarget

Parameters

title
String
icon
Icon
score
Single
componentName
ComponentName
intentExtras
Bundle
Attributes

Remarks

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