Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android action.MAIN and category.LAUNCHER function

We mention android.intent.action.MAIN and android.intent.category.LAUNCHER as Intent filter of the launcher activity in the Manifest.xml. What is imp. of these two? What are their functionality?

like image 374
dev_android Avatar asked Jun 09 '11 06:06

dev_android


People also ask

What is action and category in 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. The value must be the literal string value of an action, not the class constant.

What is a launcher category in Android?

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.

What is action Main in Android?

action. MAIN means that this activity is the entry point of the application, i.e. when you launch the application, this activity is created.


2 Answers

From the docs:

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.

MAIN means that this activity is the entry point of the application, i.e. when you launch the application, this activity is created.

like image 183
MByD Avatar answered Sep 30 '22 23:09

MByD


MAIN action is the main entry point of the application.

LAUNCHER category says that entry point should be listed in the application launcher.

like image 44
Lavanya Avatar answered Oct 01 '22 00:10

Lavanya