1.Intent specifying the start target component
2.Intentfilter describes the location of the base component
3. Remember to introduce the package where R is introduced when other packages introduce resource files
Packagecom.jikexueyuan.intent;import COM.JIAHEMEIKANG.HELLOANDROID.R;Importandroid.app.Activity;ImportAndroid.os.Bundle; Public classAty2extendsactivity{ PublicAty2 () {//TODO auto-generated Constructor stub} @Overrideprotected voidonCreate (Bundle e) {Super. OnCreate (e); Setcontentview (R.layout.aty2); }}
R's Package
/*auto-generated FILE. Do not MODIFY. * * This class is automatically generated by the * AAPT tool from the resource data it found. It * should not being modified by hand. */Package com.jiahemeikang.helloandroid; Public Final classR { Public Static Final classattr {} Public Static Final classDimen {/**Default screen margins, per the Android Design guidelines. Customize dimensions originally defined in res/values/dimens.xml (such as screens margins) for SW720DP devices (e.g . "Tablets" in landscape. */ Public Static Final intactivity_horizontal_margin=0x7f040000; Public Static Final intactivity_vertical_margin=0x7f040001; } Public Static Final classdrawable { Public Static Final intic_launcher=0x7f020000; } Public Static Final classID { Public Static Final intaction_settings=0x7f08000d; Public Static Final intbingdingservice=0x7f080000; Public Static Final intbtnclose=0x7f08000b; Public Static Final intbtngetnum=0x7f080002; Public Static Final intbtnstartaty1=0x7f080009; Public Static Final intbtnstartservice=0x7f080003; Public Static Final intbtnstopservice=0x7f080004; Public Static Final intbtnbroadcast=0x7f080006; Public Static Final intbtnregbroadcast=0x7f080007; Public Static Final intbtnunregbroadcast=0x7f080008; Public Static Final inttextview1=0x7f080005; Public Static Final inttvout=0x7f08000c; Public Static Final inttvresult=0x7f08000a; Public Static Final intunbingdingservice=0x7f080001; } Public Static Final classLayout { Public Static Final intactivity_main=0x7f030000; Public Static Final intaty1=0x7f030001; Public Static Final intaty2=0x7f030002; } Public Static Final classMenu { Public Static Final intmain=0x7f070000; } Public Static Final classString { Public Static Final intaction_settings=0x7f050001; Public Static Final intapp_name=0x7f050000; Public Static Final inthello_world=0x7f050002; } Public Static Final classStyle {/**Base application theme, dependent on API level. This theme are replaced by Appbasetheme from Res/values-vxx/styles.xml on newer devices. Theme customizations available in newer API levels can go in res/values-vxx/styles.xml, while customizations re lated to Backward-compatibility can go. Base application theme for API 11+. This theme completely replaces appbasetheme from Res/values/styles.xml on API 11+ devices. API One-theme customizations can go here. Base application theme for API 14+. This theme completely replaces appbasetheme from BOTH Res/values/styles.xml and Res/values-v11/styles.xml on API 14+ devices. API theme customizations can go to here. */ Public Static Final intappbasetheme=0x7f060000; /**application Theme. All customizations, that is, specific to a particular api-level can go. */ Public Static Final intapptheme=0x7f060001; }}
Add a good resource file to Android activty add Android Manifest
Android Learning Note Intent (1)