如何在安卓系统的启动器中隐藏应用程序[英] How to Hide app from launcher in Android

本文是小编为大家收集整理的关于如何在安卓系统的启动器中隐藏应用程序的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我正在开发一个Android应用程序.我想隐藏启动器的应用程序图标. 然后,如果键入的某些特定的否定否,则再次显示它.是否有可能做?

推荐答案

试用此代码:

PackageManager p = getPackageManager();
p.setComponentEnabledSetting(getComponentName(),
    PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 
    PackageManager.DONT_KILL_APP);

&check 这个链接.请注意,在下一次重新启动之前,图标可能不会消失.

试试:

PackageManager pm = this.getPackageManager();
pm.setComponentEnabledSetting(new ComponentName("com.google.android.talk",
    "com.google.android.talk.LAUNCHER"),
    PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
    PackageManager.DONT_KILL_APP);

希望这种帮助.

本文地址:https://www.itbaoku.cn/post/102539.html

问题描述

I am developing an android app. I want to hide the app icon from launcher. Then show it again if some specific no from dialer is typed. Is it possible to do?

推荐答案

Try this code:

PackageManager p = getPackageManager();
p.setComponentEnabledSetting(getComponentName(),
    PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 
    PackageManager.DONT_KILL_APP);

& check this link. Note that the icon may not be gone until the next reboot.

OR

Try this:

PackageManager pm = this.getPackageManager();
pm.setComponentEnabledSetting(new ComponentName("com.google.android.talk",
    "com.google.android.talk.LAUNCHER"),
    PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
    PackageManager.DONT_KILL_APP);

Hope this Help.