Android 检测用户何时退出片段
如何检测用户何时离开/退出片段?我尝试使用Android 检测用户何时退出片段,android,android-fragments,kotlin,fragment,Android,Android Fragments,Kotlin,Fragment,如何检测用户何时离开/退出片段?我尝试使用onStop() 我正在使用kotlin for android使用onDestroyView()或onDetach() onDestroyView() 在删除与片段关联的视图层次结构时调用 onDetach() 或者更多细节 使用onDetach()-onDestroy()或onDestroyViewonStop()在屏幕刚刚隐藏时调用,就像其他片段可见时一样。 Called when the fragment is being disassociat
onStop()
我正在使用kotlin for android使用onDestroyView()或onDetach()
onDestroyView()
在删除与片段关联的视图层次结构时调用
onDetach()
或者更多细节 使用onDetach()
-onDestroy()
或onDestroyView
onStop()
在屏幕刚刚隐藏时调用,就像其他片段可见时一样。
Called when the fragment is being disassociated from the activity.