Due to a condition, I need two navHostFragment in two different activities in my app.
Everything works fine until I add a second navhostframent in my app, which creates an inflateexception with error:
Binary XML file line #36: Duplicate id 0x7f09018a, tag null, or parent id 0xffffffff with another fragment for androidx.navigation.fragment.NavHostFragment
Following is my second navhost fragment:
<fragment
android:id="@+id/nav_host_fragment_supervisor"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/bottomNav"
android:layout_below="@+id/appbar"
app:defaultNavHost="true"
app:navGraph="@navigation/navigation_graph_supervisor" />
Please help.