Android 应用程序快捷方式不起作用。获取错误 "Failed to read the app data cannot start the app"

标签 android shortcut

我已经为我的应用程序创建了应用程序快捷方式。但是当我点击那个快捷方式时它说 “读取应用数据失败无法启动应用”

我已经添加了

<uses-permission android:name="android.permission.INSTALL_SHORTCUT"/>

这一行在我的 list 文件中,我也添加了

<meta-data
                android:name="android.app.shortcuts"
                android:resource="@xml/shortcuts"/>

我的主要 Intent 过滤器中的这一行:-

这是我的 shortcuts.xml 文件:-

<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
    <shortcut
        android:enabled="true"
        android:icon="@drawable/ic_trackconsignment"
        android:shortcutId="tracking"
        android:shortcutShortLabel="@string/track"
        android:shortcutLongLabel="@string/track">

        <intent
            android:action="android.intent.action.VIEW"
            android:targetPackage="in.vesolve.deliveryflyking.activities.revamp"
            android:targetClass="in.vesolve.deliveryflyking.activities.revamp.ConsignmentTrackActivity"
            />
    </shortcut>
</shortcut>

输出:- Shortcut Option
Result

我的设备:Relame 7,Android 10,Realme UI 1.0

提前致谢:)

最佳答案

在 Android manifest 文件中,在 launcher activity 标签中添加以下代码

android:exported="true"

关于Android 应用程序快捷方式不起作用。获取错误 "Failed to read the app data cannot start the app",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66207674/

相关文章:

Android 无法在 PackageManager io.crash.air 中找到此应用

java - 无法添加多条记录,ID 不自动递增

android - Games.Players.getCurrentPlayer崩溃

android - 实际 View 的高度不适合适当的内容

android - react-native 获取当前日期

git - 获取后是否有 git 命令显示新的上游提交?

ms-office - Internet 快捷方式 IDList 值解码

python - 使用 google colab 同时更改代码中的相同单词

ios - 为什么这三个 addKeyCommand 中只有两个起作用

visual-studio - Visual Studio,仅折叠/扩展区域快捷方式