I have these categories defined in the application manifest file:
<intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME"/> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter>
If I delete the line -
<category android:name="android.intent.category.HOME"/>
This does not affect any part of the functionality of the application, and I can see my application in the launch list of my main Android device.
However, if I delete the last line -
<category android:name="android.intent.category.LAUNCHER" />
I see a change that my application has disappeared from the startup list of the main screen of my Android device.
So my question is what is the purpose of this HOME category and what is its general use.
If the sole purpose of this category is to launch the main screen, as indicated in the android documents , then this can also be done as follows:
Intent homeIntent= new Intent(Intent.ACTION_MAIN); homeIntent.addCategory(Intent.CATEGORY_HOME); homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(homeIntent);
source share