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>