0

I want to navigate to a fragment instance using navcontroller but it seems that I cannot add it unless I use the fragment Id or the direction with actions.

So I want to use something as:

val fragment2 = Fragment()
findNavController().navigate(fragment2)  // this doesn't exist

The Fragment class is added to the navigation graph.

Fragment1 -> Fragment2

If I use normal transactions I can show the fragment, but then the navigation host still thinks I'm on Fragment1

htafoya
  • 18,261
  • 11
  • 80
  • 104

0 Answers0