Hi! I'm trying to use fragments for navigation. `f...
# getting-started
m
Hi! I'm trying to use fragments for navigation.
findNavController(R.id.nav_host_fragment_content_main).navigate(R.id.settingsFragment)
I'm using this inside onOptionsItemSelected in the activity (I am trying to a settings fragment when I click on the button in ActionBar). Although this is working, if I click on the settings 5 times, I also need to click back 5 times. I am aware this is intended behaviour, but I can't seem to find how to avoid this.
r
This isn't a Kotlin question. You'd probably be better off asking on Stack Overflow.
m
Oh, my bad! Sorry!
👍 1