Android Navigation component clear back stack programmatically
override fun onBackPressed() {
val navigationController = binding.navigation.findNavController()
if (navigationController.currentDestination?.id == R.id.homeFragment) {
finish()
} else {
super.onBackPressed()
}
}