Skip to content Skip to sidebar Skip to footer

How To Hide Android App From Launcher

I would like to hide my android app from the launcher, but be able to call it from within another app. I am lost on what to remove from the android manifest. Already tried removing

Solution 1:

You need to remove the following line from your AndroidManifest.xml:

<categoryandroid:name="android.intent.category.LAUNCHER"/>

This will remove the application from the default launcher. However, you also need to add the following line such that your BroadcastReceiver is not completely ignored:

<categoryandroid:name="android.intent.category.DEFAULT"/>

You should NOT remove the line below - it is used to specify which Activity should launch first when your app is opened:

<actionandroid:name="android.intent.action.MAIN"/>

EDIT

In order to launch the application discussed above from another application, you cannot use the calls shown in your question. You are trying to open the application by creating an Intent with the CATEGORY_LAUNCHER tag (i.addCategory(Intent.CATEGORY_LAUNCHER)) when you have explicitly removed the following line from your AndroidManifest.xml file:

<category android:name="android.intent.category.LAUNCHER" />

The absence of the above line means that the application you are trying to call will ignore the launch Intent. In order to launch your application you will need to act upon another Intent. Here is an example that shows how to open an application, which doesn't contain a launch intent filter, by responding to a SMS Intent: How to launch an Android app without "android.intent.category.LAUNCHER"

Which intent you choose to use is up to you - just make sure you add it to your AndroidManifest.xml file.

Solution 2:

Try this code:

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

and check this link.

hope this helps.

Post a Comment for "How To Hide Android App From Launcher"