Android Default startup program issues

Source: Internet
Author: User

Reference Address: http://www.cnblogs.com/Lewis/p/3316946.html

How do we make our own Android app set as the default boot? It is very simple, as long as you configure the first boot activity in the Androidmanifest.xml file.

<activity
Android:name= "Com.example.phone.MainActivity"
Android:label= "@string/app_name" >
<intent-filter>
<action android:name= "Android.intent.action.MAIN"/>

The default is: <category android:name= "Android.intent.category.LAUNCHER"/>


<category android:name= "Android.intent.category.HOME"/>//these two sentences never tried.
<category android:name= "Android.intent.category.DEFAULT"/>
</intent-filter>
</activity>

The part of the red font is the key code. When the configuration is complete, when you click on the Home button on your phone, you will be asked to select a launcher and select the launcher that we need.

When you want to set which activity is the startup item, add the activity that you want to start in Androidmanifest.xml

<intent-filter>
<action android:name= "Android.intent.action.MAIN"/>
<category android:name= "Android.intent.category.LAUNCHER"/>

</intent-filter>

That's all you have to say.

Android Default startup program issues

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.