title: How can I find NavController if I use view binding?
body: <p>Normally, I use <code>val navController: NavController = findNavController(R.id.nav_host_fragment)</code> in Code A to find NavController, it's based <code>R.id.nav_host_fragment</code>.</p>
  <p>Now I use view binding in the app just like Code B, how can I  NavController if I use view binding ?</p>
  <p>BTW, in my mind  <code>R.id.nav_host_fragment</code> will not be available in view binding , right?</p>
  <p><strong>Code A</strong></p>
  <pre><code>class TasksActivity : AppCompatActivity() { 
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.tasks_act)
  
          val navController: NavController = findNavController(R.id.nav_host_fragment)
       }
   
  }
  </code></pre>
  <p><strong>Code B</strong></p>
  <pre><code>class TasksActivity : AppCompatActivity() {
      
      private lateinit var binding: TasksActBinding
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
  
          binding = TasksActBinding.inflate(layoutInflater)
          val view = binding.root
          setContentView(view)       
        
          //val navController: NavController = findNavController(R.id.nav_host_fragment)       
      }
  
  }
  </code></pre>
  <p><strong>tasks_act.xml</strong></p>
  <pre><code>&lt;androidx.drawerlayout.widget.DrawerLayout
      xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:id=&quot;@+id/drawer_layout&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      tools:context=&quot;.tasks.TasksActivity&quot;
      tools:openDrawer=&quot;start&quot;&gt;
  
      &lt;LinearLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          android:orientation=&quot;vertical&quot;&gt;
  
          &lt;com.google.android.material.appbar.AppBarLayout
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;&gt;
  
              &lt;androidx.appcompat.widget.Toolbar
                  android:id=&quot;@+id/toolbar&quot;
                  android:layout_width=&quot;match_parent&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:minHeight=&quot;?attr/actionBarSize&quot;
                  android:theme=&quot;@style/Toolbar&quot;
                  app:popupTheme=&quot;@style/ThemeOverlay.AppCompat.Light&quot; /&gt;
          &lt;/com.google.android.material.appbar.AppBarLayout&gt;
  
          &lt;fragment
              android:id=&quot;@+id/nav_host_fragment&quot;
              android:name=&quot;androidx.navigation.fragment.NavHostFragment&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;match_parent&quot;
  
              app:defaultNavHost=&quot;true&quot;
              app:navGraph=&quot;@navigation/nav_graph&quot; /&gt;
  
      &lt;/LinearLayout&gt;
  
      ..
  
  &lt;/androidx.drawerlayout.widget.DrawerLayout&gt;
  </code></pre>