Skip to content

Instantly share code, notes, and snippets.

Last active Jun 3, 2022
What would you like to do?
const val SHORTCUT_SECOND_ID = "id_second"
fun createNewShortcut() {
val shortcutManager = getSystemService(context,
val secondActivity = ShortcutInfo.Builder(context, SHORTCUT_SECOND_ID)
/* you should start with the Launcher Activity */
Intent(Intent.ACTION_VIEW, null, context,,
Intent(Intent.ACTION_VIEW, null, context,
shortcutManager!!.dynamicShortcuts = listOf(secondActivity)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment