I am not clear about what is the difference between category home and category launcher. From Android documentation page:
CATEGORY_HOME : This is the home activity, that is the first activity that is displayed when the device boots.
CATEGORY_LAUNCHER : Should be displayed in the top-level launcher.
To test the difference I made a simple app with this manifest:
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".IntentCategoriesActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Second"
android:label="Whatever" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</activity>
</application>
But all I see is my launcher activity not the second activity.
Can somebody please explain what am I missing? Thanks.
category -- Gives additional information about the action to execute. For example, CATEGORY_LAUNCHER means it should appear in the Launcher as a top-level application, while CATEGORY_ALTERNATIVE means it should be included in a list of alternative actions the user can perform on a piece of data.
The way I understand it, categories are public directives to the android operating system(and other apps) that represent different categories that your app should be a part of. Example.
Standard categories are defined in the Intent class as CATEGORY_name constants. The name assigned here can be derived from those constants by prefixing " android. intent. category. " to the name that follows CATEGORY_ . For example, the string value for CATEGORY_LAUNCHER is " android.
action : Declares the intent action accepted, in the name attribute. The value must be the literal string value of an action, not the class constant. category: Declares the intent category accepted, in the name attribute.
android.intent.category.HOME
is used for Home Screen activities like ADW Launcher, Launcher Pro, etc. If you want to create a new home screen use this.
android.intent.category.LAUNCHER
is used to specify which of your activities can be launched. I.e. which ones show up in the app drawer.
android.intent.category.HOME
- To be a launcher - this activity is homescreen
android.intent.category.LAUNCHER
- To be in launcher - this activity is visible in menu
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With