On the first day, "⑤, program entry point." "The problem with the entry point of the program is mentioned, but more general,
Here, say it again:
<application android:allowbackup= "true" android:icon= "@drawable/ic_launcher" android: Label= "@string/app_name" android:theme= "@android: style/ Theme.Black.NoTitleBar.Fullscreen "> <activity android:name= ". Mainactivity " android:screenorientation=" Portrait " android:label=" @string/app_name " > <intent-filter> <action android:name= " Android.intent.action.MAIN "/>&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&Nbsp; <category android:name= "Android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application>
All activity programs are registered in the Androidmanifest.xml file, so the file is the core profile for the entire Android project.
The android:icon= "@drawable/ic_launcher" configured in the <application> node represents the reference drawable (drawable-hdpi, drawable-ldpi, DRAWABLE-MDPI three folders Import) the icon of the resource configuration, the name of the introduction icon is Ic_launcher;
The android:label= "@string/app_name" configured in the <application> node indicates that the label name of this application is read from the Strings.xml file and the content is app_name corresponding content; Of course, you can also change the title of the activity .
Activity is an active form, and a project application can contain multiple activities.
<intent-filter> <action android:name= "Android.intent.action.MAIN"/> <category android:name= "Android Oid.intent.category.LAUNCHER "/></intent-filter>
The activity contains the above tag, which means that the program is the activity that launches the tag by default:
The method is specified as follows:
①, Android:name= ". Mainactivity "Specifies the. java file in SRC;
②, in the corresponding. java file
protected void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview (R.layout.activity_main);
}
where Setcontentview (r.layout.activity_main);, specify the layout XML in Res-layout.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////