I have had this issue that seems kind of weird to me. When looking at my app through the Layout Inspector, I can see that my navHostFragment is nested inside itself for some reason:
However, here is what part of my layout file looks like:
<androidx.drawerlayout.widget.DrawerLayout 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/activity_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false"
tools:context=".core.MainActivity">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/activity_coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/navHostFragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
I do not inflate another navHostFragment in the fragment container view, so why is the navHostFragment duplicated in layout inspector? Is this somehow normal or is there a hidden navHostFragment being inflated somehow?
