ShortcutManagerCompat

public class ShortcutManagerCompat
extends Object

java.lang.Object
   ↳ androidx.core.content.pm.ShortcutManagerCompat


Helper for accessing features in ShortcutManager.

Summary

Constants

String EXTRA_SHORTCUT_ID

Key to get the shortcut ID from extras of a share intent.

int FLAG_MATCH_CACHED

Include cached shortcuts in the result.

int FLAG_MATCH_DYNAMIC

Include dynamic shortcuts in the result.

int FLAG_MATCH_MANIFEST

Include manifest shortcuts in the result.

int FLAG_MATCH_PINNED

Include pinned shortcuts in the result.

Public methods

static boolean addDynamicShortcuts(Context context, List<ShortcutInfoCompat> shortcutInfoList)

Publish the list of dynamic shortcuts.

static Intent createShortcutResultIntent(Context context, ShortcutInfoCompat shortcut)

Returns an Intent which can be used by the launcher to pin shortcut.

static void disableShortcuts(Context context, List<String> shortcutIds, CharSequence disabledMessage)

Disable pinned shortcuts, showing the user a custom error message when they try to select the disabled shortcuts.

static void enableShortcuts(Context context, List<ShortcutInfoCompat> shortcutInfoList)

Re-enable pinned shortcuts that were previously disabled.

static List<ShortcutInfoCompat> getDynamicShortcuts(Context context)

Return all dynamic shortcuts from the caller app.

static int getIconMaxHeight(Context context)

Return the max height for icons, in pixels.

static int getIconMaxWidth(Context context)

Return the max width for icons, in pixels.

static int getMaxShortcutCountPerActivity(Context context)