What is the alternative to removing the following from AndroidManifest:
<activity
android:name="com.apper.main.UserActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true" >
<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>
</activity>
I also found that after removing the above line, there was no impact to my android application. What's the main use of this category and what's the alternative to it.
If the intent of this category is to launch the home screen then it can be done by the following:
Intent homeIntent= new Intent(Intent.ACTION_MAIN);
homeIntent.addCategory(Intent.CATEGORY_HOME);
homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(homeIntent);
This above code will launch the home screen but why the line in the android manifest ? What's the purpose as removing the line from here does nothing change the application ?
What's the main use of this category
It, coupled with ACTION_MAIN
, identifies a replacement home screen.
what's the alternative to it
Not having it. Either you have this category, or you do not.
The category HOME is used to declare your application as a Home launcher. By putting this in the manifest then user will have the option to have your application open upon pressing the home button.
This is typically used when creating an application that will be used in a kiosk mode.
I do not believe there is an alternative to make an application a home launcher.
Documentation
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