Android 8.0 Shortcuts 点击时报错:未安装该应用

android7.1新特性


image.png

公司项目在一段时间后发现这个功能突然不能用了,点击时toast提示“未安装该应用”,
解决方案如下:
发现是 android:targetClass和android:targetPackage配置问题

    <shortcut
        android:enabled="true"
        android:icon="@drawable/qrcode"
        android:shortcutDisabledMessage="@string/shortcut_disable"
        android:shortcutId="scan"
        android:shortcutLongLabel="@string/shortcut_scan_long"
        android:shortcutShortLabel="@string/scan">

        <intent
            android:action="android.intent.action.VIEW"
            android:targetClass="com.xxxxxx.android.main.qrcode.QRCodeScanActivity"//这里配置正常的包名
           android:targetPackage="com.xxxxxx.applicationId" />//这里要配置applicationId

        <categories android:name="android.shortcut.conversation" />
    </shortcut>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 175,172评论 25 709
  • 用两张图告诉你,为什么你的 App 会卡顿? - Android - 掘金 Cover 有什么料? 从这篇文章中你...
    hw1212阅读 14,467评论 2 59
  • 1、通过CocoaPods安装项目名称项目信息 AFNetworking网络请求组件 FMDB本地数据库组件 SD...
    阳明AI阅读 16,038评论 3 119
  • 本来人就比较内向,现在更是喜欢一个人独处,一个人的时候一点也不寂寞,观察内心,观察思维,好玩的很呢。这里面有整个世...
    行进中的路人甲阅读 663评论 0 0
  • 昨天晚上,随意写了篇《在这座城市里,曾经住过这些人》,芦墟朱映茵阿姨留言,写了很多文字。 与朱阿姨...
    黄叶村人阅读 4,535评论 4 3