android - 无法从 Android 菜单中隐藏应用程序图标?

标签 android

我也遇到过这样一种情况,我想从我的应用程序 (X) 开始安装第三方应用程序(比如说应用程序 Y),但我不希望在 Android 主菜单上创建应用程序 Y 图标。

我已经尝试了下面的代码,但在应用 Y 成功安装后,主菜单中仍然有一个应用 Y 的图标被创建。请记住,我无法更改 App Y 的 list ,因为它是第三方应用程序。

我也试过以下链接的建议,但它们没有解决我的问题:

How to hide application icon from the Android Desktop? ++++++++++

File file = new File("/sdcard/MyApps/App Y.apk");

Intent intent = new Intent();
Uri uri = Uri.fromFile(file);

intent.setAction(android.content.Intent.ACTION_VIEW);

intent.removeCategory("android.intent.category.LAUNCHER");

intent.setDataAndType(Uri.parse(uri.toString()),
"application/vnd.android.package-archive");

startActivity(intent);

++++++++++

请让我知道您对此的建议/意见。

谢谢

最佳答案

执行此操作的唯一方法是删除包的 AndroidManifest.xml 文件中定义的 IntentFilter:第三方安装程序无法执行此操作。

关于android - 无法从 Android 菜单中隐藏应用程序图标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6780919/

相关文章:

java.lang.NoClassDefFoundError : Failed resolution

java - 无法使用 STREAM_VOICE_CALL 通过 Android Java 中的 MediaPlayer 播放音频

java - android数据库表未在其他 Activity 中创建?

java - 如何在标签上书写多个字符 - Obj C 和 Java

android - 改造2处理动态错误

java - 垂直拖放到 RecyclerView 上后如何保留 firestore 中的项目位置

android - 来自多个通知的启动 Activity 会覆盖之前的 Intent

android - android可以使用BroadcastReceiver在没有Service的情况下播放音乐吗?

android - IntelliJ IDEA 无法将库源提交到 svn

java - 膨胀 View 与膨胀元素