一、Activity的生命周期图:
二、Fragment生命周期图
三、对比图
Log数据
Activity﹕ onCreate
Fragment﹕ onAttach
Fragment﹕ onCreate
Fragment﹕ onCreateView
Fragment﹕ onActivityCreated
Fragment﹕ onStart
Activity﹕ onStart
Activity﹕ onResume
Fragment﹕ onResume
Fragment﹕ onPause
Activity﹕ onPause
Fragment﹕ onStop
Activity﹕ onStop
Fragment﹕ onDestroyView
Fragment﹕ onDestroy
Fragment﹕ onDetach
Activity﹕ onDestroy