Activity (i) Create basic activity
1. Activity is a component that contains a user interface that is used primarily for interacting with users.
2, one of the most basic activity creation process
① to create a new empty project
② Create a Mainactivity
③ Create a new layout
④ registered in Androidmanifest, all activities are registered here
⑤ specify an activity as the primary activity
<activity
Android:name= ". Mainactivity "
Android:label= "@string/title_activity_main"
Android:theme= "@style/apptheme.noactionbar" >
<intent-filter>
<action android:name= "Android.intent.action.MAIN"/>
<category android:name= "Android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
3, one of the most basic activity completed
(ii) Life cycle of activity
1, Oncreate-->onstart-->onresume-->onpause-->onstop-->ondestroy
2. The complete life cycle of an activity consists of six steps above, when the activity is visible at OnPause, when it returns to the top of the stack, returning to Onresume, when it is killed because of memory tension, start the activity again from OnCreate
3, the activity is in OnStop, is in the invisible State, when it is killed because of memory tension, start the activity again from OnCreate, when it returns to the top of the stack, call Onrestart back to OnStart
Android Development Learning-four components (1)