We mention android.intent.act开发者_JAVA百科ion.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?
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.
MAIN
action is the main entry point of the application.
LAUNCHER
category says that entry point should be listed in the application launcher.
MAIN : will start the activity home.This activity will be the Home page of the application.
CATEGORY_LAUNCHER : The activity can be the initial activity of a task and is listed in the top-level application launcher.
MAIN: the activity is the main entry point to the application i.e., the first activity to start when application starts
LAUNCHER: the activity will appear in top-level application launcher (where app icons appear and user can launch one of them).
Additionally, If two activites in an application have MAIN and LAUNCHER, then two icons will start appearing in top-level application launcher. Where each icon corresponds to each app activity
精彩评论