Call removeMenuProvider on Fragment::onStop

This commit is contained in:
LoveSy 2023-06-22 01:07:15 +08:00 committed by John Wu
parent dc26ad7125
commit 0a85ef61c3

View File

@ -92,4 +92,10 @@ abstract class BaseFragment<Binding : ViewDataBinding> : Fragment(), ViewModelHo
navigation?.currentDestination?.getAction(actionId)?.let { navigation!!.navigate(this) }
}
override fun onStop() {
if (this is MenuProvider) {
activity?.removeMenuProvider(this)
}
super.onStop()
}
}