enableShortcuts

open fun enableShortcuts(@NonNull context: Context, @NonNull shortcutInfoList: List<ShortcutInfoCompat>)(source)

Re-enable pinned shortcuts that were previously disabled. If the target shortcuts are already enabled, this method does nothing.

In API 31 and below any shortcuts that are marked as excluded from launcher will be ignored. Compatibility behavior:

  • API 25 and above, this method matches platform behavior.
  • API 24 and earlier, this method behaves the same as addDynamicShortcuts

Throws

If trying to enable immutable shortcuts.

when the user is locked.