Androidmanifest.xml
<?XML version= "1.0" encoding= "Utf-8"?><Manifestxmlns:android= "Http://schemas.android.com/apk/res/android" Package= "Com.sxt.day03_01"Package Name, modify the package name under SRC also to modify Android:versioncode= "1"Android:versionname= "1.0" > <USES-SDKandroid:minsdkversion= "8"lowest compatible mobile phone system, Android 2.2 android:targetsdkversion= "+" />this project SDK version<Applicationdescription of the Mainactivity class, registration, not registered to use Android:allowbackup= "true"do this automatically backup Android:icon= "@drawable/ic_launcher"icons for items in the phone Android:label= "@string/app_name"text Android:theme for items in the phone= "@style/apptheme" >topics used in the project<Activitymainactivity Android:name= "Com.sxt.day03_01.MainActivity"name Android:label= "@string/app_name" > <Intent-filter>Intent Filter<ActionAndroid:name= "Android.intent.action.MAIN" />indicates that this activity is the entry of the entire project. Main activity, click on the Mobile software icon The first activity to enter is the activity at main level.<categoryAndroid:name= "Android.intent.category.LAUNCHER" />category, launcher represents the top-level list</Intent-filter> </Activity> </Application></Manifest>
Activity Common methods:
Packagecom.sxt.day02_06;ImportCOM.SXT.DAY03_01.R;Importandroid.app.Activity;ImportAndroid.os.Bundle;ImportAndroid.util.Log;ImportAndroid.view.View;ImportAndroid.widget.Button; Public classMainactivityextendsActivity {@Overrideprotected voidOnCreate (Bundle savedinstancestate) {//after the view loads the first call method, the activity is created automatically, cannot new, can invoke the method to start him, Super. OnCreate (savedinstancestate); Setcontentview (r.layout.activity_main);//set the activity's layout to show the activity's layoutFindviewbyid (R.id.rbfemale);//in the ID of this class R this internal class to find this value, and then find this ID identifies something, the return value is the view } //The onclick value is a method of GridLayout the button's Click event Response Public voidGridLayout (View v) {//v is the button of the point, and view is the parent of all controlsLOG.I ("main", ((Button) v). GetText (). toString ()); Setcontentview (r.layout.gridlayout); }}
Android Androidmanifest.xml