Answers for "android navigation component remove fragment from backstack"

3

how to remove fragment from backstack in navigation component

override fun onBackPressed() {
   val navigationController = binding.navigation.findNavController()
     if (navigationController.currentDestination?.id == R.id.homeFragment) {
         finish()
     } else {
         super.onBackPressed()
       }
}
Posted by: Guest on November-02-2021

Code answers related to "android navigation component remove fragment from backstack"

Code answers related to "Dart"

Browse Popular Code Answers by Language