I have a NavGraph
like this in the NavController
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mobile_navigation"
app:startDestination="@+id/nav_home">
<fragment
android:id="@+id/nav_home"
android:name="com.bradley.kon.ui.dashboard.DashboardFragment"
android:label="@string/menu_dashboard"
tools:layout="@layout/fragment_home" />
<fragment
android:id="@+id/nav_projects"
android:name="com.bradley.kon.ui.projects.ProjectsFragment"
android:label="@string/menu_projects"
tools:layout="@layout/fragment_projects" />
<fragment
android:id="@+id/nav_locations"
android:name="com.bradley.kon.ui.locations.LocationsFragment"
android:label="@string/menu_locations"
tools:layout="@layout/fragment_locations" />
<fragment
android:id="@+id/nav_settings"
android:name="com.bradley.kon.ui.settings.SettingsFragment"
android:label="@string/menu_settings"
tools:layout="@layout/fragment_settings" />
So inside ProjectsFragment
there is a ListView
, such that when the Item is clicked on the ListView, it navigates to the LocationsFragment
with a bundle like this
NavController navController =
Navigation.findNavController(getActivity(), R.id.nav_host_fragment_content_main);
navController.navigate(R.id.nav_locations, projectBundle);
So upon reaching the LocationsFragment
I cannot go to the ProjectsFragment
from the NavController. (See in the GIF)
What am I missing?