Android Development self-study Notes (vi): Declarative Permissions and Activity_android

Source: Internet
Author: User

Sorry Oh, the last piece of Android self-study development Sixth code control interface dug a hole, if not run up classmate, please pay attention to view this article.

Android Project's soul Master Androidmanifest.xml is finally on the scene, and we can call it a am file, knowing and learning to configure AM files is a very important basis for learning about Android.

Am file defines the required permissions for the Android app, the components that require life, and some information that interacts with other apps, I think I need to further explain AM file, look forward to my update it!

Well, back in the pit, we've used a series of articles about how to develop a look professional program, but the problem is it doesn't run!!! The problem arises because we forgot to submit our usage rights to the AM file and our activity classes.

Declaring permissions

Because we need access to the network, we need to have access to the network.

Copy Code code as follows:

<uses-permission android:name= "Android.permission.INTERNET" ></uses-permission>

We have defined two activity, respectively, myactivity and resultactivity, so we need to submit it.

Copy Code code as follows:

<activity android:name= "myactivity" android:label= "@string/app_name" >
<intent-filter>
<action android:name= "Android.intent.action.MAIN"/>
<category android:name= "Android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name= "Resultactivity"
Android:label= "@string/app_name" >
</activity>

Where MyActivity also has such a child node: Intent-filter, if you see that the intent-filter contains a child node that is defined above, then the entry activity that is used to indicate when the program starts is myactivity. Because if the property values of these two nodes contain main and launcher respectively, it is the entry activity when the program is started.

OK, now start running your program again.

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.