1. 程式人生 > >Activity的生存週期

Activity的生存週期

1》開啟MainActivity

11-05 21:18:41.929 15123-15123/cn.edu.npu.activitylifecycletest D/MainActivity: *********onCreate*********
11-05 21:18:41.938 15123-15123/cn.edu.npu.activitylifecycletest D/MainActivity: *********onStart*********
11-05 21:18:41.939 15123-15123/cn.edu.npu.activitylifecycletest D/MainActivity: *********onResume*********

2》開啟NormalActivity

11-05 21:20:03.907 15123-15123/cn.edu.npu.activitylifecycletest D/MainActivity: *********onPause*********
11-05 21:20:04.580 15123-15123/cn.edu.npu.activitylifecycletest D/MainActivity: *********onStop*********

3》返回

11-05 21:20:38.026 15123-15123/cn.edu.npu.activitylifecycletest D/MainActivity: *********onRestart*********
11-05 21:20:38.026 15123-15123/cn.edu.npu.activitylifecycletest D/MainActivity: *********onStart*********
11-05 21:20:38.026 15123-15123/cn.edu.npu.activitylifecycletest D/MainActivity: *********onResume*********

4》開啟DialogActivity

11-05 21:21:29.521 15123-15123/cn.edu.npu.activitylifecycletest D/MainActivity: *********onPause*********

5》返回

11-05 21:21:49.400 15123-15123/cn.edu.npu.activitylifecycletest D/MainActivity: *********onResume*********

6》退出

11-05 21:22:12.053 15123-15123/cn.edu.npu.activitylifecycletest D/MainActivity: *********onPause*********
11-05 21:22:12.086 15123-15123/cn.edu.npu.activitylifecycletest D/MainActivity: *********onStop*********
11-05 21:22:12.086 15123-15123/cn.edu.npu.activitylifecycletest D/MainActivity: *********onDestroy*********