📅  最后修改于: 2022-03-11 14:58:25.358000             🧑  作者: Mango
override fun onBackPressed() {
val navigationController = binding.navigation.findNavController()
if (navigationController.currentDestination?.id == R.id.homeFragment) {
finish()
} else {
super.onBackPressed()
}
}