Launch Fragment (instead of Activity) from Android 7.1 App Shortcut
<p>I have decided to look at adding static shortcuts into an application, using this page as reference:</p>

<p><a href="https://developer.android.com/preview/shortcuts.html" rel="noreferrer">https://developer.android.com/preview/shortcuts.html</a></p>

<p>The XML for my shortcuts currently looks like so:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;shortcuts xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;shortcut
        android:shortcutId="id"
        android:enabled="true"
        android:icon="@drawable/icon"
        android:shortcutShortLabel="@string/short_label"
        android:shortcutLongLabel="@string/long_label"
        android:shortcutDisabledMessage="@string/disabled_message"&gt;
        &lt;intent
            android:action="android.intent.action.VIEW"
            android:targetPackage="com.example"
            android:targetClass="com.example.Activity" /&gt;
        &lt;categories android:name="android.shortcut.category" /&gt;
    &lt;/shortcut&gt;
&lt;/shortcuts&gt;
</code></pre>

<p>The issue comes from the <code>targetClass</code> variable as I cannot find a way to launch a <code>Fragment</code> rather than an <code>Activity</code>. Most of the main pages I would want to launch from the shortcuts are <code>Fragments</code> displayed within an <code>Activity</code>. How can I get the <code>intent</code> to launch straight to a <code>Fragment</code> instead?</p>