I have FragmentA (belongs to main_nav_graph
) whose layout contains a FragmentContainerView
in which I load a secondary_nav_graph
. FragmentB (child fragment) to be loaded in the container registers a fragmentResultListener
in order to be triggered once a button from FragmentA (parent fragment) is clicked and consequently receive data from parent. This is not working because children fragment belong to a different navigation graph, in my case the secondary_nav_graph.
If the children fragments belong to no navigation graph and are loaded in the container by using the traditional way by calling inside the parent: getChildFragmentManager().beginTransaction().replace(R.id.frame, new FragmentB()).commit();
it is going to work correctly.
Any idea how to make it work by having the children Fragment in a different Navigation graph
?