Life cycle Activity
http://blog.csdn.net/android_tutor/article/details/5772285 http://www.cnblogs.com/JohnTsai/p/4052676.html
1. Go to App OnCreate (), OnStart ()->onresume ()
2. Exit App OnPause ()->onstop ()->ondestroy ()
3. Click Home or leave the current page OnPause ()->onstop ()
4. From previous page back to current page Onrestart ()->onstart ()->onresume ()
Life Cycle Service
One through activity
1. First start service StartService () onCreate (), the second turn on service does not trigger
2. Close service OnDestroy ()
Two by binding
1. First open service OnCreate ()->onbind () The second turn on service no longer triggers
2. Close the service Onunbind ()->ondestroy () Unbind can use Unbindservice (), the system calls Onunbind ()-->ondestory () in turn;
Onsaveinstancestate () is used to preserve the state of the activity before it is killed.
OnPause () to store persistent data
Getting Started with Android-life cycle activity