I am making a simple app with a recycler containing a list of items, and when an item is clicked, it needs to navigate to a new separate page for that item.(Note that the recycler view with list of items and the item page are both fragments and the navigation needs to happen without starting a new activity)
I have set up the NavHostFragment in MainActivity and the onClickListener to get the item clicked in the onBindViewHolder method of Adapter classs of the fragment with recycler view. I cannot figure out how to call the navController in MainACtivity within the onClickListener method in Adapter class to navigate to the item fragment, or is there any other way to do this? I am newbie android studio dev! Please help, thanks!