java.lang.Object | |
↳ | android.service.chooser.ChooserTarget |
A ChooserTarget represents a deep-link into an application as returned by a
ChooserTargetService
.
A chooser target represents a specific deep link target into an application exposed for selection by the user. This might be a frequently emailed contact, a recently active group messaging conversation, a folder in a cloud storage app, a collection of related items published on a social media service or any other contextually relevant grouping of target app + relevant metadata.
Creators of chooser targets should consult the relevant design guidelines for the type of target they are presenting. For example, targets involving people should be presented with a circular icon.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct a deep link target for presentation by a chooser UI.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
| |||||||||||
Returns the ComponentName of the Activity that should be launched for this ChooserTarget.
| |||||||||||
Returns the icon representing this target for display to a user.
| |||||||||||
Returns the Bundle of extras to be added to an intent launched to this target.
| |||||||||||
Returns the ranking score supplied by the creator of this ChooserTarget.
| |||||||||||
Returns the title of this target for display to a user.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
| |||||||||||
Flatten this object in to a Parcel.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
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
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 Parcelable
types into
the extras bundle, as the system will not be able to unparcel them to merge them.
title | title of this target that will be shown to a user |
---|---|
icon | icon to represent this target |
score | ranking score for this target between 0.0f and 1.0f, inclusive |
componentName | Name of the component to be launched if this target is chosen |
intentExtras | Bundle of extras to merge with the extras of the launched intent |
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
Returns the ComponentName of the Activity that should be launched for this ChooserTarget.
Returns the icon representing this target for display to a user. The UI displaying the icon may crop, resize or overlay this icon.
Returns the Bundle of extras to be added to an intent launched to this target.
Returns the ranking score supplied by the creator of this ChooserTarget. Values are between 0.0f and 1.0f. The UI displaying the target may take this score into account when sorting and merging targets from multiple sources.
Returns the title of this target for display to a user. The UI displaying the title may truncate this title if it is too long to be displayed in full.
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
Flatten this object in to a Parcel.
dest | The Parcel in which the object should be written. |
---|---|
flags | Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE .
|