Create a new resource file: res / xml / shortcuts.xml. This is how you create shortcuts after you made a nicicary manifest change
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"> <shortcut android:shortcutId="compose" android:enabled="true" android:icon="@drawable/compose_icon" android:shortcutShortLabel="@string/compose_shortcut_short_label1" android:shortcutLongLabel="@string/compose_shortcut_long_label1" android:shortcutDisabledMessage="@string/compose_disabled_message1"> <intent android:action="android.intent.action.VIEW" android:targetPackage="your package" android:targetClass="com.example.myapplication.ComposeActivity" /> </shortcut> </shortcuts>
In the manifest, add this to the activity tag,
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
If you want to read more, check out the doc , which explains about attached shortcuts, static and dynamic shortcuts.
Here is an example from google, in my repo samples
source share