I am trying to add this to NavControllers in order to replace fragments.
Another way is to use fragment transactions to replace fragments like this tutorial:
https://www.youtube.com/watch?v=fmrYeiw-0EQ
But that's not what i wanted. Kindly provide some way to use NavController
Eg:
val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
navController = navHostFragment.navController
setupWithNavController(binding.bottomNav, navController)<==== Error here
Currently gives error at setupWithNavController(binding.bottomNav, navController)
I am trying to add this to NavControllers in order to replace fragments.
Another way is to use fragment transactions to replace fragments like this tutorial:
https://www.youtube.com/watch?v=fmrYeiw-0EQ
But that's not what i wanted. Kindly provide some way to use NavController
Eg:
Currently gives error at setupWithNavController(binding.bottomNav, navController)