views:

61

answers:

1

How do I exclude an application from appearring in the Application Launcher. The code below is used to add on to the launcher but when I exclude it, the launcher still appears.

<activity android:name=".Application" android:label="@string/app_name">
   <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.LAUNCHER" />
   </intent-filter>
</activity>
+3  A: 

Remove the android.intent.category.LAUNCHER category:

<activity android:name=".Application" android:label="@string/app_name">
   <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.DEFAULT" />
   </intent-filter>
</activity>
Cristian
And depending on how you want your app to be launched you may omit the `intent-filter` all together. If you only want it to be launched by calling out the specific class it's unneeded.
CaseyB
Thanks for the responses. I'll give some more detail which will convolute this even further. That Application class is actually contained in an Android Library project used by another application. I had removed the Launcher category but it still appearred. In fact I emptied the manifest file like this: <activity android:name=".Application" android:label="@string/app_name"> </activity>Now I have even made the application class abstract and it is extended by the Main class of the non-library app. I still have a launcher with the library name.
androider
@androider: Then there is some problem with your library project and how it is being incorporated into the parent project.
CommonsWare