ShortcutInfoCompat

public class ShortcutInfoCompat
extends Object

java.lang.Object
   ↳ androidx.core.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.

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 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 methods

getActivity

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.

Returns
ComponentName

getCategories

public Set<String> getCategories ()

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

Returns
Set<String>

getDisabledMessage

public CharSequence getDisabledMessage ()

Return the message that should be shown when the user attempts