Jetpack Navigation fragment lifecycle not right

Viewed 432

I tried to change my old project to Androidx and Navigation. I used navigate to second Fragment, but if I close second Fragment too fast, it will not run onDestroyView and onDestroy, my screen gets blocked by white.

Normal lifecycle is :

E: Match   onAttach
E: Match   onCreate
E: Match   onViewCreated
E: Match   onStart
E: Match   onResume
E: Register   onPause
E: Register   onStop
E: Register   onDestroyView

My project's lifecycle is :

E: MineFragmentNew   onPause
E: MineFragmentNew   onStop
E: SettingFragment   onAttach
E: SettingFragment   onCreate
E: SettingFragment   onViewCreated
E: SettingFragment   onStart
E: MineFragmentNew   onDestroyView
E: SettingFragment   onResume

If I close too fast :

E: MineFragmentNew   onPause
E: MineFragmentNew   onStop
E: SettingFragment   onAttach
E: SettingFragment   onCreate
E: SettingFragment   onViewCreated
E: SettingFragment   onStart
E: SettingFragment   onStop
E: MineFragmentNew   onStart
E: MineFragmentNew   onResume

It's an old project done by others. I tried to change a lot of settings.

1 Answers
Related