Search code examples
androidandroid-manifestintentfilterandroid-launcher

Hiding the launcher activity from list of apps in custom launcher application in Android


I'm creating a launcher application, and want it to have a settings activity where the user can tweak the behaviour of the application.

But i don't want for the launcher application to show the activity which starts the launcher

(has the intent filters <category android:name="android.intent.category.HOME"/> and <category android:name="android.intent.category.DEFAULT"/>),

and still retain that when the user presses the home button, my application comes up as a viable candidate.

So my question is, how to hide the launcher activity from the launcher so that instead of both the activities (settings and launcher), only the settings activity is shown.


Solution

  • If you remove the <intent-filter> with ACTION=MAIN and CATEGORY=LAUNCHER from your launcher activity, it won't show up in the list of available applications.

    To change the label of the settings activity, just add

    android:label="@string/settings_name"
    

    to the <activity> tag for your settings activity and create an appropriate string resource.