Android 7.1 Static Shortcut

Tony Owen
Tony Owen
Oct 21, 2016 · 2 min read
“Never taken a shortcut before?”
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:shortcutId="quickStart"
android:enabled="true"
android:icon="@drawable/ic_vector_shortcut"
android:shortcutShortLabel="@string/quickstart"
android:shortcutLongLabel="@string/quickstart_long"
android:shortcutDisabledMessage="@string/quickstart_disabled">
<intent
android:action="com.your.app.QUICKSTART"
android:targetPackage="com.your.app"
android:targetClass="com.your.app.activities.MainActivity" />
</shortcut>
<!-- Specify more shortcuts here. -->
</shortcuts>

<meta-data android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />

private static final String ACTION_QUICKSTART = "com.your.app.QUICKSTART";

if (ACTION_QUICKSTART.equals(getIntent().getAction())){
startQuickStart();
}

Tony Owen

Written by

Tony Owen

Flutter Fan Boy & Android Developer

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade