Implementing Android App Shortcuts

To the left are the App Shortcuts presented when Google Maps is long pressed. To the right I’ve pinned the Work shortcut to the home screen. Clicking the Work shortcut opens navigation to work from your current location.
Konstellations/app/src/main/AndroidManifest.xml
Konstellations/app/src/main/res/xml-v25/shortcuts.xml
The shortcut Aries is disabled, and when clicked, displays a Toast indicating that it’s disabled.
Note how the shortcut uses “Aries, the Ram” the long label for the app shortcuts menu, but uses “Aries” the short label when the shortcut is pinned.
Konstellations/app/src/main/kotlin/com/orobator/konstellations/ShortcutHelper.kt
Konstellations/app/src/main/kotlin/com/orobator/konstellations/ShortcutHelper.kt
The overflow menu for ConstellationDetailActivity.kt
Konstellations/app/src/main/kotlin/com/orobator/konstellations/ConstellationDetailActivity.kt
Konstellations/app/src/main/kotlin/com/orobator/konstellations/ConstellationDetailActivity.kt
Konstellations/app/src/main/kotlin/com/orobator/konstellations/ShortcutHelper.kt
adb shell cmd shortcut reset-throttling [ --user your-user-id ]

--

--

Android Dev @ genevachat.com Twitter: @AOrobator

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store