在7.1之前的设备中不显示静态快捷方式

时间:2017-04-01 11:47:29

标签: android android-launcher

我刚刚实现了3个静态快捷方式,它们在Android 7.1中运行良好。但是,使用静态快捷方式,我预计它们也可以在使用Nova Launcher的Android 7.0(或6,未尝试)的设备中工作,但它们没有出现。为什么?这是我的代码之一:

    <shortcut
        android:shortcutId="ND Fragment"
        android:enabled="true"
        android:icon="@drawable/icon_filter"
        android:shortcutShortLabel="@string/title_nd"
        android:shortcutLongLabel="@string/title_nd">
        <intent
            android:action="android.intent.action.VIEW"
            android:targetPackage="com.gmail.nellorocca.dslrtools"
            android:targetClass="com.gmail.nellorocca.dslrtools.MainActivity">
            <extra android:name="extra_name" android:value="launch_nd"/>
        </intent>

        <categories android:name="android.shortcut.conversation" />
    </shortcut>

1 个答案:

答案 0 :(得分:2)

已经解决了Chris Lacy(Action Launcher的开发人员)指南。 您需要在指向的任何活动中添加android:exported = true。

来源:http://theblerg.net/post/2016/10/1/integrating-android-71s-launcher-shortcuts-into-your-app