title: How to set Nav Controller in AndroidX?
body: <p>I'm using the following activity layout with a <code>fragment</code> and a <code>BottomNavigationView</code>:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"&gt;
  
      &lt;fragment
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:id="@+id/fragment"
          android:layout_weight="1"
          android:name="androidx.navigation.fragment.NavHostFragment"
          app:newGraph="@navigation/navigation_bottom"
          app:defaultNavHost="true"/&gt;
  
      &lt;com.google.android.material.bottomnavigation.BottomNavigationView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/bottom_navigation_view"
          app:menu="@menu/bottom_navigation_menu"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>In my activity, I'm trying to setup the Nav Controller this but I'm getting the following error:</p>
  
  <blockquote>
    <p>Cannot resolve method 'setupWithNavController(androidx.navigation.NavController)'</p>
  </blockquote>
  
  <p>This is what I have tried:</p>
  
  <pre><code>navController = Navigation.findNavController(this, R.id.fragment);
  BottomNavigationView bnv = findViewById(R.id.bottom_navigation_view);
  bnv.setupWithNavController(navController); //Error
  NavigationUI.setupActionBarWithNavController(this, navController);
  </code></pre>
  
  <p>My dependencies:</p>
  
  <pre><code>implementation 'android.arch.navigation:navigation-fragment:1.0.0-rc02'
  implementation 'android.arch.navigation:navigation-ui:1.0.0-rc02'
  </code></pre>
  
  <p>How can I wire this up? Thanks!</p>