Set the Android startup interface in the AndroidManifest. xml file

Source: Internet
Author: User

For example, the Login program of Android and the Helloworld program of Android cannot run a correct program correctly. It has been depressing for a long time, finally, after a test, the program of the self-built project was successfully run in the Android simulator. The following is a summary of the procedure startup interface settings:

In the Android project created by MyEclipse, find the AndroidManifest. xml file and double-click it.

After setting the program running, start the AndroidManifest. xml file on the Login interface as follows:

<? Xml version = "1.0" encoding = "UTF-8"?>
<Manifest xmlns: android = "http://schemas.android.com/apk/res/android"
Package = "com. gp. aciti.pdf"
Android: versionCode = "1"
Android: versionName = "1.0" type = "codeph" text = "/codeph">
<! -- Set the Android SDK version running in the simulator -->
<Uses-sdk android: minSdkVersion = "8" android: targetSdkVersion = "18"/>
<! -- Get network operation permissions -->
<Uses-permission android: name = "android. permission. CHANGE_NEWWORK_STATE"/>
<! -- Android running settings -->
<Application
Android: allowBackup = "true"
Android: icon = "@ drawable/ic_launcher"
Android: label = "@ string/app_name"
Android: theme = "@ style/AppTheme">
<! -- Start the Login interface settings for online collection and sorting -->
<Activity
Android: name = "com. gp. acitivity. LoginActivity">

<! -- Set the program to be started first. Copy the following code to the specified position for the Activity to be started -->
<Intent-filter>
<Action android: name = "android. intent. action. MAIN"/>
<Category android: name = "android. intent. category. LAUNCHER"/>
</Intent-filter>
</Activity>
<! -- Start the Helloworld interface settings for online collection and sorting -->
<Activity
Android: name = "com. gp. acitivity. HellowoldActivity">
</Activity>
</Application>
</Manifest>

 

After setting the program running, start the AndroidManifest. xml file on the HelloWorld interface as follows:

<? Xml version = "1.0" encoding = "UTF-8"?>
<Manifest xmlns: android = "http://schemas.android.com/apk/res/android"
Package = "com. gp. aciti.pdf"
Android: versionCode = "1"
Android: versionName = "1.0" type = "codeph" text = "/codeph">
<! -- Set the Android SDK version running in the simulator -->
<Uses-sdk android: minSdkVersion = "8" android: targetSdkVersion = "18"/>
<! -- Get network operation permissions -->
<Uses-permission android: name = "android. permission. CHANGE_NEWWORK_STATE"/>
<! -- Android running settings -->
<Application
Android: allowBackup = "true"
Android: icon = "@ drawable/ic_launcher"
Android: label = "@ string/app_name"

Android: theme = "@ style/AppTheme">
<! -- Start the Login interface settings for online collection and sorting -->
<Activity
Android: name = "com. gp. acitivity. LoginActivity">
</Activity>
<! -- Start the Helloworld interface settings for online collection and sorting -->
<Activity
Android: name = "com. gp. acitivity. HellowoldActivity">
<! -- Set the program to be started first. Copy the following code to the specified position for the Activity to be started -->
<Intent-filter>
<Action android: name = "android. intent. action. MAIN"/>
<Category android: name = "android. intent. category. LAUNCHER"/>
</Intent-filter>
</Activity>
</Application>
</Manifest>

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.