安卓生命周期回调流程

2023-11-29 16:43
152
0

安卓打开应用并在各操作下回调调用流程

DefaultApplication      :应用的Application实现类,并注册了Activity生命周期回调

MainActivity                :打开的Activity

StartPageFragment    :Activity中的Fragment

‘onPostCreate 1’         :为Activity中onPostCreate(savedInstanceState: Bundle?)回调,onPostCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) 未发送回调

T:main                         :发送在main线程

2023-11-29 16:26:40.666 23749-23749 DefaultApplication      T:main onCreate 

2023-11-29 16:26:40.724 23749-23749 DefaultApplication      T:main onActivityPreCreated

2023-11-29 16:26:40.730 23749-23749 DefaultApplication      T:main onActivityCreated

2023-11-29 16:26:40.733 23749-23749 MainActivity            T:main onCreate 

2023-11-29 16:26:40.733 23749-23749 MainActivity            T:main before beginTransaction

2023-11-29 16:26:40.785 23749-23749 MainActivity            T:main after beginTransaction

2023-11-29 16:26:40.786 23749-23749 MainActivity            T:main end onCreate

2023-11-29 16:26:40.788 23749-23749 DefaultApplication      T:main onActivityPostCreated

2023-11-29 16:26:40.790 23749-23749 DefaultApplication      T:main onActivityPreStarted

2023-11-29 16:26:40.790 23749-23749 DefaultApplication      T:main onActivityStarted

2023-11-29 16:26:40.795 23749-23749 StartPageFragment       T:main onAttach

2023-11-29 16:26:40.796 23749-23749 StartPageFragment       T:main onAttachcontext

2023-11-29 16:26:40.797 23749-23749 StartPageFragment       T:main onCreateView

2023-11-29 16:26:40.806 23749-23749 StartPageFragment       T:main onViewCreated

2023-11-29 16:26:40.807 23749-23749 StartPageFragment       T:main onStart

2023-11-29 16:26:40.809 23749-23749 MainActivity            T:main onStart

2023-11-29 16:26:40.810 23749-23749 DefaultApplication      T:main onActivityPostStarted

2023-11-29 16:26:40.811 23749-23749 MainActivity            T:main onPostCreate 1

2023-11-29 16:26:40.812 23749-23749 DefaultApplication      T:main onActivityPreResumed

2023-11-29 16:26:40.815 23749-23749 DefaultApplication      T:main onActivityResumed

2023-11-29 16:26:40.816 23749-23749 MainActivity            T:main onResume

2023-11-29 16:26:40.821 23749-23749 StartPageFragment       T:main onResume

2023-11-29 16:26:40.822 23749-23749 MainActivity            T:main onPostResume

2023-11-29 16:26:40.822 23749-23749 DefaultApplication      T:main onActivityPostResumed

2023-11-29 16:26:40.843 23749-23749 MainActivity            T:main onAttachedToWindow

2023-11-29 16:26:40.923 23749-23749 MainActivity            T:main onWindowFocusChanged true

-----息屏-----

2023-11-29 16:26:48.571 23749-23749 DefaultApplication      T:main onActivityPrePaused

2023-11-29 16:26:48.577 23749-23749 DefaultApplication      T:main onActivityPaused

2023-11-29 16:26:48.581 23749-23749 StartPageFragment       T:main onPause

2023-11-29 16:26:48.583 23749-23749 MainActivity            T:main onPause

2023-11-29 16:26:48.585 23749-23749 DefaultApplication      T:main onActivityPostPaused

2023-11-29 16:26:48.608 23749-23749 DefaultApplication      T:main onActivityPreStopped

2023-11-29 16:26:48.612 23749-23749 DefaultApplication      T:main onActivityStopped

2023-11-29 16:26:48.615 23749-23749 StartPageFragment       T:main onStop

2023-11-29 16:26:48.617 23749-23749 MainActivity            T:main onStop

2023-11-29 16:26:48.619 23749-23749 DefaultApplication      T:main onActivityPostStopped

2023-11-29 16:26:48.621 23749-23749 DefaultApplication      T:main onActivityPreSaveInstanceState

2023-11-29 16:26:48.625 23749-23749 DefaultApplication      T:main onActivitySaveInstanceState

2023-11-29 16:26:48.630 23749-23749 DefaultApplication      T:main onActivityPostSaveInstanceState

2023-11-29 16:26:49.001 23749-23749 MainActivity            T:main onWindowFocusChanged false

解锁

2023-11-29 16:26:51.285 23749-23749 DefaultApplication      T:main onActivityPreStarted

2023-11-29 16:26:51.286 23749-23749 DefaultApplication      T:main onActivityStarted

2023-11-29 16:26:51.287 23749-23749 StartPageFragment       T:main onStart

2023-11-29 16:26:51.288 23749-23749 MainActivity            T:main onStart

2023-11-29 16:26:51.290 23749-23749 DefaultApplication      T:main onActivityPostStarted

2023-11-29 16:26:51.291 23749-23749 DefaultApplication      T:main onActivityPreResumed

2023-11-29 16:26:51.292 23749-23749 DefaultApplication      T:main onActivityResumed

2023-11-29 16:26:51.292 23749-23749 MainActivity            T:main onResume

2023-11-29 16:26:51.296 23749-23749 StartPageFragment       T:main onResume

2023-11-29 16:26:51.297 23749-23749 MainActivity            T:main onPostResume

2023-11-29 16:26:51.298 23749-23749 DefaultApplication      T:main onActivityPostResumed

2023-11-29 16:26:51.442 23749-23749 MainActivity            T:main onWindowFocusChanged true

-----返回桌面-----

2023-11-29 16:26:55.112 23749-23749 DefaultApplication      T:main onActivityPrePaused

2023-11-29 16:26:55.115 23749-23749 DefaultApplication      T:main onActivityPaused

2023-11-29 16:26:55.116 23749-23749 StartPageFragment       T:main onPause

2023-11-29 16:26:55.117 23749-23749 MainActivity            T:main onPause

2023-11-29 16:26:55.118 23749-23749 DefaultApplication      T:main onActivityPostPaused

2023-11-29 16:26:55.122 23749-23749 MainActivity            T:main onWindowFocusChanged false

2023-11-29 16:26:55.139 23749-23749 DefaultApplication      T:main onActivityPreStopped

2023-11-29 16:26:55.141 23749-23749 DefaultApplication      T:main onActivityStopped

2023-11-29 16:26:55.141 23749-23749 StartPageFragment       T:main onStop

2023-11-29 16:26:55.142 23749-23749 MainActivity            T:main onStop

2023-11-29 16:26:55.143 23749-23749 DefaultApplication      T:main onActivityPostStopped

2023-11-29 16:26:55.143 23749-23749 DefaultApplication      T:main onActivityPreSaveInstanceState

2023-11-29 16:26:55.144 23749-23749 DefaultApplication      T:main onActivitySaveInstanceState

2023-11-29 16:26:55.145 23749-23749 DefaultApplication      T:main onActivityPostSaveInstanceState

-----回到应用-----

2023-11-29 16:26:58.203 23749-23749 DefaultApplication      T:main onActivityPreStarted

2023-11-29 16:26:58.204 23749-23749 DefaultApplication      T:main onActivityStarted

2023-11-29 16:26:58.205 23749-23749 StartPageFragment       T:main onStart

2023-11-29 16:26:58.206 23749-23749 MainActivity            T:main onStart

2023-11-29 16:26:58.207 23749-23749 DefaultApplication      T:main onActivityPostStarted

2023-11-29 16:26:58.208 23749-23749 DefaultApplication      T:main onActivityPreResumed

2023-11-29 16:26:58.209 23749-23749 DefaultApplication      T:main onActivityResumed

2023-11-29 16:26:58.209 23749-23749 MainActivity            T:main onResume

2023-11-29 16:26:58.213 23749-23749 StartPageFragment       T:main onResume

2023-11-29 16:26:58.214 23749-23749 MainActivity            T:main onPostResume

2023-11-29 16:26:58.215 23749-23749 DefaultApplication      T:main onActivityPostResumed

2023-11-29 16:26:58.285 23749-23749 MainActivity            T:main onWindowFocusChanged true

-----下拉状态栏-----

2023-11-29 16:26:59.682 23749-23749 MainActivity            T:main onWindowFocusChanged false

-----收起状态栏-----

2023-11-29 16:27:01.904 23749-23749 MainActivity            T:main onWindowFocusChanged true

-----打开侧边栏-----

2023-11-29 16:27:03.606 23749-23749 MainActivity            T:main onWindowFocusChanged false

-----收起侧边栏-----

2023-11-29 16:27:10.773 23749-23749 MainActivity            T:main onWindowFocusChanged true

-----返回键退出应用-----

2023-11-29 16:27:16.370 23749-23749 MainActivity            T:main onBackPressed

2023-11-29 16:27:16.394 23749-23749 DefaultApplication      T:main onActivityPrePaused

2023-11-29 16:27:16.396 23749-23749 DefaultApplication      T:main onActivityPaused

2023-11-29 16:27:16.397 23749-23749 StartPageFragment       T:main onPause

2023-11-29 16:27:16.398 23749-23749 MainActivity            T:main onPause

2023-11-29 16:27:16.399 23749-23749 DefaultApplication      T:main onActivityPostPaused

2023-11-29 16:27:16.507 23749-23749 MainActivity            T:main onWindowFocusChanged false

2023-11-29 16:27:16.529 23749-23749 DefaultApplication      T:main onActivityPreStopped

2023-11-29 16:27:16.531 23749-23749 DefaultApplication      T:main onActivityStopped

2023-11-29 16:27:16.532 23749-23749 StartPageFragment       T:main onStop

2023-11-29 16:27:16.532 23749-23749 MainActivity            T:main onStop

2023-11-29 16:27:16.533 23749-23749 DefaultApplication      T:main onActivityPostStopped

2023-11-29 16:27:16.534 23749-23749 DefaultApplication      T:main onActivityPreDestroyed

2023-11-29 16:27:16.536 23749-23749 DefaultApplication      T:main onActivityDestroyed

2023-11-29 16:27:16.537 23749-23749 StartPageFragment       T:main onDestroyView

2023-11-29 16:27:16.551 23749-23749 StartPageFragment       T:main onDestroy

2023-11-29 16:27:16.552 23749-23749 StartPageFragment       T:main onDetach

2023-11-29 16:27:16.555 23749-23749 MainActivity            T:main onDestroy

2023-11-29 16:27:16.556 23749-23749 DefaultApplication      T:main onActivityPostDestroyed

2023-11-29 16:27:16.557 23749-23749 MainActivity            T:main onDetachedFromWindow

-----任务栏切回应用-----

2023-11-29 16:27:37.701 23749-23749 DefaultApplication      T:main onActivityPreCreated

2023-11-29 16:27:37.704 23749-23749 DefaultApplication      T:main onActivityCreated

2023-11-29 16:27:37.705 23749-23749 MainActivity            T:main onCreate 

2023-11-29 16:27:37.705 23749-23749 MainActivity            T:main before beginTransaction

2023-11-29 16:27:37.721 23749-23749 MainActivity            T:main after beginTransaction

2023-11-29 16:27:37.722 23749-23749 MainActivity            T:main end onCreate

2023-11-29 16:27:37.724 23749-23749 DefaultApplication      T:main onActivityPostCreated

2023-11-29 16:27:37.725 23749-23749 DefaultApplication      T:main onActivityPreStarted

2023-11-29 16:27:37.726 23749-23749 DefaultApplication      T:main onActivityStarted

2023-11-29 16:27:37.727 23749-23749 StartPageFragment       T:main onAttach

2023-11-29 16:27:37.728 23749-23749 StartPageFragment       T:main onAttachcontext

2023-11-29 16:27:37.729 23749-23749 StartPageFragment       T:main onCreateView

2023-11-29 16:27:37.741 23749-23749 StartPageFragment       T:main onViewCreated

2023-11-29 16:27:37.742 23749-23749 StartPageFragment       T:main onStart

2023-11-29 16:27:37.743 23749-23749 MainActivity            T:main onStart

2023-11-29 16:27:37.744 23749-23749 DefaultApplication      T:main onActivityPostStarted

2023-11-29 16:27:37.745 23749-23749 MainActivity            T:main onPostCreate 1

2023-11-29 16:27:37.745 23749-23749 DefaultApplication      T:main onActivityPreResumed

2023-11-29 16:27:37.746 23749-23749 DefaultApplication      T:main onActivityResumed

2023-11-29 16:27:37.747 23749-23749 MainActivity            T:main onResume

2023-11-29 16:27:37.750 23749-23749 StartPageFragment       T:main onResume

2023-11-29 16:27:37.751 23749-23749 MainActivity            T:main onPostResume

2023-11-29 16:27:37.752 23749-23749 DefaultApplication      T:main onActivityPostResumed

2023-11-29 16:27:37.772 23749-23749 MainActivity            T:main onAttachedToWindow

2023-11-29 16:27:37.879 23749-23749 MainActivity            T:main onWindowFocusChanged true

-----返回键退出应用-----

2023-11-29 16:27:43.723 23749-23749 MainActivity            T:main onBackPressed

2023-11-29 16:27:43.750 23749-23749 DefaultApplication      T:main onActivityPrePaused

2023-11-29 16:27:43.752 23749-23749 DefaultApplication      T:main onActivityPaused

2023-11-29 16:27:43.754 23749-23749 StartPageFragment       T:main onPause

2023-11-29 16:27:43.755 23749-23749 MainActivity            T:main onPause

2023-11-29 16:27:43.756 23749-23749 DefaultApplication      T:main onActivityPostPaused

2023-11-29 16:27:43.826 23749-23749 MainActivity            T:main onWindowFocusChanged false

2023-11-29 16:27:43.832 23749-23749 DefaultApplication      T:main onActivityPreStopped

2023-11-29 16:27:43.833 23749-23749 DefaultApplication      T:main onActivityStopped

2023-11-29 16:27:43.834 23749-23749 StartPageFragment       T:main onStop

2023-11-29 16:27:43.835 23749-23749 MainActivity            T:main onStop

2023-11-29 16:27:43.835 23749-23749 DefaultApplication      T:main onActivityPostStopped

2023-11-29 16:27:43.836 23749-23749 DefaultApplication      T:main onActivityPreDestroyed

2023-11-29 16:27:43.837 23749-23749 DefaultApplication      T:main onActivityDestroyed

2023-11-29 16:27:43.839 23749-23749 StartPageFragment       T:main onDestroyView

2023-11-29 16:27:43.839 23749-23749 StartPageFragment       T:main onDestroy

2023-11-29 16:27:43.840 23749-23749 StartPageFragment       T:main onDetach

2023-11-29 16:27:43.841 23749-23749 MainActivity            T:main onDestroy

2023-11-29 16:27:43.841 23749-23749 DefaultApplication      T:main onActivityPostDestroyed

2023-11-29 16:27:43.842 23749-23749 MainActivity            T:main onDetachedFromWindow

-----杀死应用-----

---------------------------- PROCESS ENDED (23749) for package  ----------------------------

全部评论