In my App I'm using the Android Navigation Component. My MainActivity has a NavigationGraph and I can navigate properly. Since I also need to implemend Search functionality I added a SearchActivity with a SearchFragment. The Search shows a RecyclerView with the Resultset. When I click one of these Results I want to navigate to the specific Fragment of MainActivity.
Unfortunately the App just Navigates to the first Fragment of MainActivity. How do I navigate to a Fragment of another Activity?
I navigate to the Fragment of MainActivity by this:
Bundle bundle = new Bundle();
bundle.putInt(SessionFragment.ARG_PARAM1, mSessions.get(position).session.getId());
navController.navigate(R.id.sessionFragment, bundle);
Any ideas?