Http://www.cnblogs.com/xunmengqishi/archive/2012/03/23/2414382.html
As described in the previous articleProgramI have some knowledge about Android. First of all, I suggest learning java. Because Android application-layer development is based on the Java language, I suggest you go to http://developer.android.com/index.htmlandroid developer's official website.
This article introduces an Android app with an interface. The three main components of Android are activty, intent, and services.
Activty: Activity in Chinese translation. Android robots act as a page (panel) activity. Android provides us with an API class, which contains several important methods.
Oncreate (bundle savedinstancestate)
Onstart ()
Onresume ()
Onpause ()
Onstop ()
Ondestroy ().
1:Public ClassExampleactivity extends activity {
2:
3:Public VoidOncreate (bundle savedinstancestate ){
4:Super. oncreate (savedinstancestate );
5:// This method is executed during program initialization.
6:}
7:@ Override
8:Protected VoidOnstart (){
9:Super. onstart ();
10:// This method is executed when the program panel becomes visible
11:}
12:@ Override
13:Protected VoidOnresume (){
14:Super. onresume ();
15: // Execute when the program panel is visible (but it is a method to return to the interface again)
16:}
17:@ Override
18:Protected VoidOnpause (){
19:Super. onpause ();
20:// Another activity is being concentrated (this activity is about "paused ").
21:}
22:@ Override
23:Protected VoidOnstop (){
24:Super. onstop ();
25:// The page is no longer visible (now in the "STOPPED" status) and is executed
26:}
27:@ Override
28:Protected VoidOndestroy (){
29:Super. ondestroy ();
30:// Executed when the page is destroyed
31:}
32:}
The lifecycle diagram of activty is a common question in the android developer's written examination:
Method called by each method in activty (panel)
In the kill refers to the unexpected situation of the program, such as whether the system can be forced to shut down when there is no response or the system crashes, in the future, the execution of the next method will be executed after a method is executed.