I'm not sure if I'm describing the issue properly, s I'll be happy to give more information with some guidance.
I have a recyclerView that I'm implementing using groupie.
Each element contains a few buttons, and one should navigate to a new fragment.
I've implemented navigation using the navigation graph.
when trying to use
findNavController().navigate(action)
As I usually would, it doesn't work.
I've tried viewHolder.root.findNavController().navigate(action)
And it doesn't work either.
I keep getting this error:
navigation destination XXXXX is unknown to this NavController
How can I bridge it to make it work?
@Tsabary hey, first of all - this is not a library issue, but your own. Define a listener for your scenario. So whenever you tap on a button that navigates to a different screen, your fragment will handle that, no need to pass "NavHost" anywhere. In other words, recycler will tell it's parent, which is fragment or activity or whatever, that user tapped on the button.
Most helpful comment
@Tsabary hey, first of all - this is not a library issue, but your own. Define a listener for your scenario. So whenever you tap on a button that navigates to a different screen, your fragment will handle that, no need to pass "NavHost" anywhere. In other words, recycler will tell it's parent, which is fragment or activity or whatever, that user tapped on the button.