How to hide the application from the launcher in Android

I am developing an Android application. I want to hide the application icon from the launcher. Then show it again if you are dialing a specific number from the dialer. Can this be done?

0
source share
1 answer

Try this code:

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

& check out this link. Please note that the icon may not disappear until the next reboot.

OR

Try the following:

 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.

0
source

All Articles