Removing an app icon from launcher

On Android you find a lot of apps who are free and with installing an extra “app” you get extra features.

A few examples are:
– Out of milk
– Andlytics
– COL Reminder

After activation the app should be installed but you want to remove only the app icon in the launcher.

Here is how you can to this:

ComponentName componentToDisable =  new ComponentName("com.colapps.reminder",
"com.colapps.reminder.LauncherActivity");

getPackageManager().setComponentEnabledSetting(
componentToDisable, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);

Hint:
“com.colapps.reminder” stands for the package name.
“com.colapps.reminder.LauncherActivity” stands for the Activity name.

Please read carefully before using this code:

  • the disabled component will not be launchable in any way
  • the icon will only disapper when the launcher is restarted, normally on the next reboot of the phone

If you have any question feel free to post an comment.