Start the

  • Fragment Life cycle execution sequence

    • onAttach() ——-> onCreate() ——-> onCreateView() ——>onViewCreated() —–> onStart() ——> onResume()
  • The Activity life cycle of the Fragment and the execution order of the Fragment life cycle

    • onCreate()(Activity)——> onAttach() ——-> onCreate() ——-> onCreateView() ——>onViewCreated() —–> onStart()——-> onStart()(Activity) ——–>onResume()(Activity) ——–> onResume()

exit

  • Fragment Life cycle execution sequence

    • onPause() ——–> onStop() ——–> onDestoryView() ——–> onDestory() ———> onDetach()
  • The Activity life cycle of the Fragment and the execution order of the Fragment life cycle

    • onPause() ——–>onPause()(Activity) ——–> onStop() ———> onStop()(Activity) ———> onDestoryView() ——–> onDestory() ——–> onDetach()———->onDestory()(Activity)

Home button

  • Fragment Life cycle execution sequence

    • onPuse() ——-> onStop()
  • The Activity life cycle of the Fragment and the execution order of the Fragment life cycle

    • onPuse() ——->onPause()(Activity) ——-> onStop() ——–>onStop()(Activity)

To open the

  • Fragment Life cycle execution sequence

    • onStart() ——> onResume()
  • The Activity life cycle of the Fragment and the execution order of the Fragment life cycle

    • onRestart()(Activity) ——–> onStart() ——-> onStart()(Activity) ——->onResume()(Activity) ——–> onResume()

Jump to Actiivty

  • Fragment Life cycle execution sequence

    • onPause() —–> onStop()
  • The Activity life cycle of the Fragment and the execution order of the Fragment life cycle

    • onPause() ——–> onPause()(Activity) ——> onStop() ——-> onStop()(Actiivty)

Returns from the previous page

  • Fragment Life cycle execution sequence

    • onStart() ——–> onResume()
  • The Activity life cycle of the Fragment and the execution order of the Fragment life cycle

    • onRestart()(Activity) ——–> onStart() ——-> onStart()(Activity) ——->onResume()(Activity) ——–> onResume()

Open the Acttivy popbox

  • Fragment Life cycle execution sequence

    • onPause()
  • The Activity life cycle of the Fragment and the execution order of the Fragment life cycle

    • onPause() ——> onPause()(Activity)

Exit the Activity dialog box

  • Fragment Life cycle execution sequence

    • onResume()
  • The Activity life cycle of the Fragment and the execution order of the Fragment life cycle:

    • onResume()(Activity) ——> onResume()