Essential Android ShortcutManager edit forum

Dynamic Launcher Shortcuts

ShortcutManager shortcutManager = getSystemService(ShortcutManager.class);

ShortcutInfo shortcut = new ShortcutInfo.Builder(this, "id1")
    .setShortLabel("Web site") // Shortcut Icon tab
    .setLongLabel("Open the web site") // Displayed When Long Pressing On App Icon
    .setIcon(Icon.createWithResource(context, R.drawable.icon_website))
    .setIntent(new Intent(Intent.ACTION_VIEW,
                   Uri.parse("https://www.mysite.example.com/")))
    .build();

shortcutManager.setDynamicShortcuts(Arrays.asList(shortcut));

We can remove all dynamic shortcuts easily by calling :-

shortcutManager.removeAllDynamicShortcuts();

We can update existing Dynamic Shorcuts by Using

shortcutManager.updateShortcuts(Arrays.asList(shortcut);

Please note that setDynamicShortcuts(List)is used to redefine the entire list of dynamic shortcuts, addDynamicShortcuts(List) is used to add dynamic shortcuts to existing list of dynamic shortcuts

ShortcutManager/
ShortcutManager
Dynamic Launcher Shortcuts

Table Of Contents
39 ACRA
64 Menu
112 Loader
119 Xposed
132 Colors
135 Fresco
140 AdMob
147 Button
156 Vk SDK
170 XMPP
176 OpenCV
190 ShortcutManager
200 FileIO
203 Moshi
217 Paint
231 AIDL
241 JCodec
243 Okio
255 Looper
  ↑ ↓ to navigate     ↵ to select     Esc to close