tags:

views:

623

answers:

2

Hello,

Is there a way of removing an activity from the home launcher by itself at runtime? I mean removing Intent.CATEGORY_LAUNCHER from it's properties or something similar.

+4  A: 

You can disable a component via PackageManager#setComponentEnabledSetting(), which will have the effect of removing it from the Launcher.

CommonsWare
I tried this out, and works like a charm. Thanks.
Lucas S.
How would this work if you later would re-install your app. Is there no problem as you have disabled it?
PHP_Jedi
I tried it and it works, but I the launcher need to be restarted in order for the icon to disappear. Do you know how to refresh the launcher icons?
yuku
+1  A: 

Tried it, the icon is still in the Launcher but when I click on it, it shows a toast "Application is not installed on your phone" :(

BoD