隐藏应用程序快捷方式

Hide application shortcut

我正在尝试制作一个我试图隐藏启动器快捷方式的应用程序。这样做的原因是,我可以将此应用程序用作另一个应用程序的模块/扩展,而不会显示它或使启动器环境混乱(即,在您的 phone 上安装此应用程序将解锁另一个应用程序中的部分功能)。我一直在研究如何做到这一点,但我找不到合适的解决方案。

我已阅读有关此问题的 'solution',它告诉我从 AndroidManifest.xml 文件中删除 <category android:name="android.intent.category.LAUNCHER" />。然而,这会导致 Android Studio 无法构建或 运行 应用程序,给我一个错误 Default Activity not found (我已经用一个新项目和一个空的 activity).

我正在尝试在我的个人设备上开发此应用程序,该设备是华为 P9 Lite,运行ning android 6.0

有办法吗?

编辑

我读过 somewhere Google 从 android 6.0 开始删除了卸载快捷方式的功能。虽然它并没有真正说明隐藏您的应用程序的快捷方式,但我继续并假设它是同一安全修复程序的一部分。

有没有办法为最新的平台版本执行此操作?

I have read a 'solution' to this issue that tells me to remove from the AndroidManifest.xml file.

这是正确答案。

This however results in Android Studio not being able to build or run the app at all, giving me an error that says Default Activity not found (I have tried this with a fresh project and an empty activity).

嗯,运行它可能没有意义。毕竟,你说这个应用程序是其他应用程序的插件。在许多情况下,插件本身不能 运行 独立(例如,你不能 运行 浏览器插件,除非通过托管浏览器)。

话虽如此,您可以通过 运行 > 编辑配置编辑您的 运行 配置,并选择当您 运行 模块时要发生的事情:

应用程序模块的 运行 配置默认为 "Default Activity",但您可以选择其他配置(例如 "Specific Activity")。

I've read somewhere that Google has removed the ability to uninstall shortcuts since android 6.0.

该答案与您的问题无关。