美文网首页
Android 8.0 Shortcuts 点击时报错:未安装该

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

作者: zxq_kyle | 来源:发表于2018-11-12 13:29 被阅读0次

    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 8.0 Shortcuts 点击时报错:未安装该

          本文链接:https://www.haomeiwen.com/subject/eraqfqtx.html