Android settings default start activity first

Source: Internet
Author: User

When we study, we feel that it takes time and memory to build a new project, so we often create multiple activities under one project to test

But how do we set the default first-started avtivity to verify that our new experiment is successful?

There's a androidmanifest.xml under App.src.main that records what activity you have on your project, and of course it's the default startup item.

<?xml version= "1.0" encoding= "Utf-8"? ><manifest xmlns:android= "http://schemas.android.com/apk/res/ Android "package=" Com.example.pro.first "> <application android:allowbackup=" true "android:icon=" @mipmap/ic_launcher "android:label=" @string/app_name "android:supportsrtl=" true "Android:theme=" @styl E/apptheme "> <activity android:name=". Mainactivity "> </activity> <!--attention:this is auto-generated to add Google Play services T  O your project for App indexing.        See Https://g.co/AppIndexing/AndroidStudio for more information. --<meta-data android:name= "com.google.android.gms.version" android:value= "@integer/go Ogle_play_services_version "/> <activity android:name=". Main2activity "> <intent-filter> <action android:name=" Android.intent.action.MAIN " /> <category android:name= "andRoid.intent.category.LAUNCHER "/> </intent-filter> </activity> </application>& Lt;/manifest>

  

Let's just put this code in the middle of the activity you want to start by default, just like the code above starts by default, main2activity

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

  

Android settings default start activity first

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.