Information about MAIN action and start category in Android Manifest

In the Android manifest file, what do you mean by Launcher number and MAIN action android category: name = "android.intent.category.LAUNCHER"
action android: name = "android.intent.action.MAIN"
Is it possible to make one action a laucher and the other the main action?

+4
source share
2 answers

Actions very often must support CATEGORY_DEFAULT so that they can be found using Context.startActivity() . Thus, CATEGORY_DEFAULT can appear several times.

Android does not capture the one that appears first in the manifest, but starts with activity with CATEGORY_LAUNCHER .

CATEGORY_LAUNCHER : activity can be the initial action of a task and is indicated in the top-level application launcher.

See http://developer.android.com/guide/topics/intents/intents-filters.html for details

+5
source

Expanding Balaji's answer, I will add a few things:

For beginners, there may be several entry points to the application. Suppose our application has two actions for simplicity.

You can store the <intent-filter> in both actions and contain the MAIN as well as the LAUNCHER in it. This would create two application launchers - and two identical application icons could be physically seen in your application. You click on one icon and it will start one of the actions. You press another and it will start another action.

However, if you drop the MAIN or LAUNCHER from the second action, there will be only one physical trigger for the application that launches the first action.

Having said that, the MAIN in action is used to say that when the application starts, it will start from that very action.

+2
source

All Articles