ShortcutManagerCompat
Helper for accessing features in android.content.pm.ShortcutManager.
Types
Link copied to clipboard
Properties
Link copied to clipboard
Key to get the shortcut ID from extras of a share intent.
Link copied to clipboard
Include cached shortcuts in the result.
Link copied to clipboard
Include dynamic shortcuts in the result.
Link copied to clipboard
Include manifest shortcuts in the result.
Link copied to clipboard
Include pinned shortcuts in the result.
Functions
Link copied to clipboard
open fun addDynamicShortcuts(@NonNull context: Context, @NonNull shortcutInfoList: List<ShortcutInfoCompat>): Boolean
Publish the list of dynamic shortcuts.
Link copied to clipboard
open fun createShortcutResultIntent(@NonNull context: Context, @NonNull shortcut: ShortcutInfoCompat): Intent
Returns an Intent which can be used by the launcher to pin shortcut.
Link copied to clipboard
open fun disableShortcuts(@NonNull context: Context, @NonNull shortcutIds: List<String>, @Nullable disabledMessage: CharSequence)
Disable pinned shortcuts, showing the user a custom error message when they try to select the disabled shortcuts.
Link copied to clipboard
open fun enableShortcuts(@NonNull context: Context, @NonNull shortcutInfoList: List<ShortcutInfoCompat>)
Re-enable pinned shortcuts that were previously disabled.
Link copied to clipboard
Return all dynamic shortcuts from the caller app.
Link copied to clipboard
Return the max height for icons, in pixels.
Link copied to clipboard
Return the max width for icons, in pixels.
Link copied to clipboard
Link copied to clipboard
Returns ShortcutInfoCompats that match
matchFlags
.Link copied to clipboard
Return
true
when rate-limiting is active for the caller app.Link copied to clipboard
Link copied to clipboard
open fun pushDynamicShortcut(@NonNull context: Context, @NonNull shortcut: ShortcutInfoCompat): Boolean
Publish a single dynamic shortcut.
Link copied to clipboard
Delete all dynamic shortcuts from the caller app.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Apps that publish shortcuts should call this method whenever the user selects the shortcut containing the given ID or when the user completes an action in the app that is equivalent to selecting the shortcut.
Link copied to clipboard
open fun requestPinShortcut(@NonNull context: Context, @NonNull shortcut: ShortcutInfoCompat, @Nullable callback: IntentSender): Boolean
Request to create a pinned shortcut.
Link copied to clipboard
open fun setDynamicShortcuts(@NonNull context: Context, @NonNull shortcutInfoList: List<ShortcutInfoCompat>): Boolean
Publish the list of shortcuts.
Link copied to clipboard
open fun updateShortcuts(@NonNull context: Context, @NonNull shortcutInfoList: List<ShortcutInfoCompat>): Boolean
Update all existing shortcuts with the same IDs.