added in version 26.1.0
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1

ShortcutInfoCompat

public class ShortcutInfoCompat
extends Object

java.lang.Object
   ↳ android.support.v4.content.pm.ShortcutInfoCompat


Helper for accessing features in ShortcutInfo.

Summary

Nested classes

class ShortcutInfoCompat.Builder

Builder class for ShortcutInfoCompat objects. 

Public methods

ComponentName getActivity()

Return the target activity.

CharSequence getDisabledMessage()

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

String getId()

Returns the ID of a shortcut.

Intent getIntent()

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

Intent[] getIntents()

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

CharSequence getLongLabel()

Return the long description of a shortcut.

CharSequence getShortLabel()

Return the short description of a shortcut.

ShortcutInfo toShortcutInfo()

Inherited methods

From class java.lang.Object

Public methods

getActivity

added in version 26.1.0
ComponentName getActivity ()

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.

Returns
ComponentName

getDisabledMessage

added in version 26.1.0
CharSequence getDisabledMessage ()

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

Returns
CharSequence

getId

added in version 26.1.0
String getId ()

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 ShortcutManager for details.

Returns
String

getIntent

added in version 26.1.0
Intent getIntent ()

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

Returns
Intent

See also:

getIntents

added in version 26.1.0
Intent[] getIntents ()

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

Returns
Intent[]

getLongLabel

added in version 26.1.0
CharSequence getLongLabel ()

Return the long description of a shortcut.

Returns
CharSequence

getShortLabel

added in version 26.1.0
CharSequence getShortLabel ()

Return the short description of a shortcut.

Returns
CharSequence

toShortcutInfo

added in version 27.1.0
ShortcutInfo toShortcutInfo ()

Returns
ShortcutInfo ShortcutInfo object from this compat object.