Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

ShortcutInfoCompat

open class ShortcutInfoCompat
kotlin.Any
   ↳ androidx.core.content.pm.ShortcutInfoCompat

Helper for accessing features in ShortcutInfo.

Summary

Nested classes
open

Builder class for ShortcutInfoCompat objects.

Public methods
open ComponentName?

Return the target activity.

open ShortcutInfo!

open String

Returns the ID of a shortcut.

open Array<Intent!>

Return the intent set with Builder#setIntents(Intent[]).

open Intent

Returns the intent that is executed when the user selects this shortcut.

open CharSequence

Return the short description of a shortcut.

open CharSequence?

Return the message that should be shown when the user attempts to start a shortcut that is disabled.

open MutableSet<String!>?

Return the categories set with Builder#setCategories(Set).

open CharSequence?

Return the long description of a shortcut.

Public methods

getActivity

@Nullable open fun getActivity(): ComponentName?

Return the target activity.

This has nothing to do with the activity that this shortcut will launch. Launcher apps should show the launcher icon for the returned activity alongside this shortcut.

toShortcutInfo

open fun toShortcutInfo(): ShortcutInfo!
Return
ShortcutInfo!: ShortcutInfo object from this compat object.

getId

@NonNull open fun getId(): String

Returns the ID of a shortcut.

Shortcut IDs are unique within each publisher app and must be stable across devices so that shortcuts will still be valid when restored on a different device. See android.content.pm.ShortcutManager for details.

getIntents

@NonNull open fun getIntents(): Array<Intent!>

Return the intent set with Builder#setIntents(Intent[]).

getIntent

@NonNull open fun getIntent(): Intent

Returns the intent that is executed when the user selects this shortcut. If setIntents() was used, then return the last intent in the array.

getShortLabel

@NonNull open fun getShortLabel(): CharSequence

Return the short description of a shortcut.

getDisabledMessage

@Nullable open fun getDisabledMessage(): CharSequence?

Return the message that should be shown when the user attempts to start a shortcut that is disabled.

getCategories

@Nullable open fun getCategories(): MutableSet<String!>?

Return the categories set with Builder#setCategories(Set).

getLongLabel

@Nullable open fun getLongLabel(): CharSequence?

Return the long description of a shortcut.