There are in total 5 fragments: Home, Movie, TV, and Profile - part of the bottom navigation Detail fragment - gives details for specific movie or TV series.
I was using a navigation component to navigate between bottom navigation fragments and now I have defined actions for Detail fragments as shown in the image but now, it gives an error for navigation between fragments if done after I open the detail fragment then, it gives :
Error - IllegalArgumentException : Navigation action/destination cannot be found from the current destination Destination
Now, I want to know how can I proceed further in an efficient way if possible.
Please let me know if more info is required and please explain and suggest a solution for the same.
Previously, I implemented a navigation component for 4 fragments of bottom navigation to navigate among each other but when I considered the detail fragment which is neither present in the drawer layout nor in bottom navigation then I added that fragment to the nav graph XML file and created connections as seen in image and defined actions.
So, now it is for actions to be defined but why it is not using the navigation component I have defined before to navigate among 4 fragments?
I was thinking of connecting all bottom navigation fragments with each but that will be very cluttering in terms of code and graph. So, please suggest a way to understand how it is working and what can be done to solve this issue.
Below are images
Nav Graph:
Main Activity:
Detail Fragment:
Code for 4 fragments navigation:



