gpt4 book ai didi

android - 7.1 之前的设备中未显示静态快捷方式

转载 作者:行者123 更新时间:2023-11-29 17:00:45 26 4
gpt4 key购买 nike

我刚刚实现了 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>

最佳答案

感谢 Chris Lacy(Action Launcher 的开发人员)指南,解决了这个问题。您需要在您指向的任何 Activity 中添加 android:exported=true。

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

关于android - 7.1 之前的设备中未显示静态快捷方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43156467/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com