Reputation: 1496
I have an interesting problem - at least for me. I don't want my application to have a launcher icon in the menu - I start it remotely and I don't want to show it up in the menu.
How can I solve that?
My idea is deleting the following from the manifest:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Would this solve my problem?
Upvotes: 2
Views: 5986
Reputation: 69
https://stackoverflow.com/a/13552763/6481542 is correct, but to address the Android Studio compilation issue noted in the comments, you need to modify the Run Configuration in Android Studio:
Default Activity
to any of the other options. Using Specified Activity
with one of your activities is a suitable approach.This works with Android Studio 2.2.3.
Upvotes: 3
Reputation: 72603
Delete that:
<category android:name="android.intent.category.LAUNCHER" />
And you won't have a launcher icon.
Upvotes: 5
Reputation: 1581
That's what i would do. This defines the gateway activity to your application and doesn't affect the functionality. If no activity has this filter, there won't be an icon to launch it manually, precisely what you want.
Upvotes: 3