安卓Activity生命周期(转)

http://www.oschina.net/question/54100_27841

启动:onCreate()->onStart()->onResume

当从Activity界面直接按Back键,onPause()->onStop()->onDestory()

当从Activity界面按home键。onPause()->onStop(),

接着再进入Activity时onRestart()->onStart()->onResume()

public class Activity extends ApplicationContext {
        protected void onCreate(Bundle savedInstanceState);        
        protected void onStart();           
        protected void onRestart();        
        protected void onResume();       
        protected void onPause();        
        protected void onStop();        
        protected void onDestroy();
}

 

 

posted @ 2014-06-15 22:27  haiziguo  阅读(301)  评论(0编辑  收藏  举报