Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created February 25, 2022 01:54
Show Gist options
  • Save skydoves/e9bb0724dd5718f5ec789e89c041e69f to your computer and use it in GitHub Desktop.
Save skydoves/e9bb0724dd5718f5ec789e89c041e69f to your computer and use it in GitHub Desktop.
static_shortcut_example
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:shortcutId="message"
android:enabled="true"
android:icon="@drawable/ic_message"
android:shortcutShortLabel="@string/short_label"
android:shortcutLongLabel="@string/long_label"
android:shortcutDisabledMessage="@string/message_shortcut_disabled">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="com.example.myapplication"
android:targetClass="com.example.myapplication.ComposeActivity" />
<categories android:name="android.shortcut.conversation" />
<capability-binding android:key="actions.intent.CREATE_MESSAGE" />
</shortcut>
</shortcuts>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment