Misunderstandings between Android. Intent. Action. Main and Android. Intent. Category. Launcher

Source: Internet
Author: User

First, let's look at the Network Statement:

Android. Intent. Action. Main determines the applicationProgramThe first

Activity Android. Intent. Category. launcher determines whether the application is displayed in the program list.

After the experiment, I found a problem?
Main and launcher are not independent tasks;
Which of the following statements is true?
My test result is that if an application does not have a launcher, the APK can still be installed on the device, but cannot be seen in the desktop icon. If launcher is set for the activity and main is set at the same time, the activity can be displayed in the program icon. If main is not set, you do not know which activity to start, therefore, no icons appear. It can be seen that main refers to the activity to start after clicking the icon. Of course, main can be set for multiple activities, but only set main without setting launcher, still cannot enter the activity. It can be seen that the main and launcher settings make sense at the same time. If multiple activities are set at the same time, two icons will appear, respectively, first entering different activities. For example: lift_cycles 01 and lift_cycles 02
<Activity Android: Name = ". life_cyclesactivity "Android: Label =" lift_cycles 01 "> <intent-filter> <action Android: Name =" android. intent. action. main "/> <category Android: Name =" android. intent. category. launcher "/> </intent-filter> </activity> <activity Android: Name =" life_cyclesactivity02 "Android: label = "lift_cycles 02"> <intent-filter> <action Android: Name = "android. intent. action. main "/> <category Android: Name =" android. intent. category. launcher "/> </intent-filter> </activity>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.