Hide Android app icon after installation

I saw that there is a GPS application in Google applications, where after installation the application will not display an icon, but will work in the background.

How can i achieve this?

+6
source share
4 answers

To remove an application from Launcher, just do not put these lines with the main Activity in AndroidManifest.xml

 <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> 

and if you want to remove it programmatically, use PackageManager.setComponentEnabledSetting to remove it from Launcher as:

  ComponentName componentToDisable = new ComponentName("com.xxx.apptodisable", "com.xxx.apptodisable.LauncherActivity"); getPackageManager().setComponentEnabledSetting( componentToDisable, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); 
+5
source

use this code

 PackageManager p = getApplicationContext().getPackageManager(); p.setComponentEnabledSetting(getComponentName(),PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); 
+3
source

The best way to hide the application icon from the launch bar is to use <category android:name="android.intent.category.LEANBACK_LAUNCHER"/> in your MainActivity manifest

  <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LEANBACK_LAUNCHER"/> </intent-filter> </activity> 

also add usage features

 <uses-feature android:name="android.software.leanback" android:required="true" /> 
+1
source

Just do not perform the action with the android.intent.category.LAUNCHER component filter of the category, and that the service receives a boot transfer.

0
source

All Articles