Android action.MAIN and category.LAUNCHER function

dev_android picture dev_android · Jun 9, 2011 · Viewed 28.7k times · Source

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?

Answer

MByD picture MByD · Jun 9, 2011

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.