title: NavigationComponent: NavHostFragment inside a fragment
body: <p>I have this tabbed UI with a navigation component and a <code>BottomNavigationView</code> that handles the tabs.
  My use case involves one of these tab fragments to have a <code>BottomNavigationView</code> of its own.</p>
  <p>I don't think the <a href="https://developer.android.com/guide/navigation/navigation-nested-graphs" rel="nofollow noreferrer">nested navigation graphs</a> will work for me because I need there to be an inner <code>NavHostFragment</code> and a second <code>BottomNavigationView</code>.</p>
  <p>So I'm in the fragment which I wish to host my inner navigation graph. It contains a fragment like so.</p>
  <pre><code>&lt;androidx.fragment.app.FragmentContainerView
          android:id=&quot;@+id/inner_host_fragment&quot;
          android:name=&quot;androidx.navigation.fragment.NavHostFragment&quot;
          app:defaultNavHost=&quot;true&quot;
  </code></pre>
  <p>I need a way to get the navigation controller for the above fragment.</p>
  <p>Normally when you're in an activity you'd call the <code>findFragmentById</code> from the <code>supportFragmentManager</code> with the id you gave to your fragment.</p>
  <pre><code>val navHostFragment = supportFragmentManager.findFragmentById(R.id.outer_nav_host) as NavHostFragment
  </code></pre>
  <p>So I tried to call that on the activity object from within my inner fragment</p>
  <pre><code>requireActivity().supportFragmentManager.findFragmentById(R.id.inner_host_fragment)
  </code></pre>
  <p>But the <code>findFragmentById</code> returns null.</p>