public class ShortcutInfoCompat
extends Object


Helper for accessing features in ShortcutInfo.


Nested classes

class ShortcutInfoCompat.Builder

Builder class for ShortcutInfoCompat objects. 



Indicates system surfaces managed by a launcher app.

Public methods

ComponentName getActivity()

Return the target activity.

Set<String> getCategories()

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

CharSequence getDisabledMessage()

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

int getDisabledReason()

Returns why a shortcut has been disabled.

PersistableBundle getExtras()
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 ShortcutInfoCompat.Builder.setIntents(Intent[]).

long getLastChangedTimestamp()

Last time when any of the fields was updated.

LocusIdCompat getLocusId()

Gets the LocusIdCompat associated with this shortcut.

CharSequence getLongLabel()

Return the long description of a shortcut.

String getPackage()

Return the package name of the publisher app.

int getRank()

Returns the rank of the shortcut set with ShortcutInfoCompat.Builder.setRank(int).

CharSequence getShortLabel()

Return the short description of a shortcut.

UserHandle getUserHandle()

UserHandle on which the publisher created this shortcut.

boolean hasKeyFieldsOnly()

Return whether a shortcut only contains "key" information only or not.

boolean isCached()

Return whether a shortcut is cached.

boolean isDeclaredInManifest()

Return whether a shortcut is static; that is, whether a shortcut is published from AndroidManifest.xml.

boolean isDynamic()

Return whether a shortcut is dynamic.

boolean isEnabled()

Returns false if a shortcut is disabled with ShortcutManagerCompat.disableShortcuts(Context, List, CharSequence).

boolean isExcludedFrom(int surface)

Return true if the shortcut is excluded from specified surface.

boolean isImmutable()

Return if a shortcut is immutable, in which case it cannot be modified with any of ShortcutManagerCompat APIs.

boolean isPinned()

Return whether a shortcut is pinned.

ShortcutInfo toShortcutInfo()

Inherited methods



public static final int SURFACE_LAUNCHER

Indicates system surfaces managed by a launcher app. e.g. Long-Press Menu.

Constant Value: 1 (0x00000001)

Public methods


public 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.



public Set<String> getCategories ()

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


See also: