title: Android Navigation Architecture Component - Nav Drawer Icons
body: <p>I'm currently using the Android Architecture Component's <code>Navigation</code>, but I'm running into an issue with my <code>Navigation Drawer</code>. It shows the hamburger menu when at my starting destination, but other <code>Fragments</code> are showing the up arrow. I believe I've setup my <code>navigation_graph</code> incorrectly.</p>
  
  <p>Here you can see my nav drawer, showing 2 items, Home and Settings. When in either of these Fragments, you should see the Hamburger icon.</p>
  
  <p><a href="https://i.stack.imgur.com/0aULw.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0aULw.png" alt="nav drawer"></a></p>
  
  <p>However, when navigating to the Settings Fragment, it shows the Up arrow.</p>
  
  <p><a href="https://i.stack.imgur.com/uenci.png" rel="noreferrer"><img src="https://i.stack.imgur.com/uenci.png" alt="toolbar"></a></p>
  
  <h2>navigation.graph.xml</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;navigation 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"
      app:startDestination="@id/nav_home"&gt;
  
      &lt;!-- Start at HomeFragment --&gt;
      &lt;fragment
          android:id="@+id/nav_home"
          android:name=".HomeFragment"
          android:label="@string/home"&gt;
  
          &lt;!-- Navigate to the Search --&gt;
          &lt;action
              android:id="@+id/action_nav_home_to_nav_search"
              app:destination="@id/nav_search" /&gt;
      &lt;/fragment&gt;
  
  
      &lt;fragment
          android:id="@+id/nav_settings"
          android:name=".SettingsFragment"
          android:label="@string/settings"&gt;
  
          &lt;!-- Navigate to the Search --&gt;
          &lt;action
              android:id="@+id/action_nav_settings_to_nav_search"
              app:destination="@id/nav_search" /&gt;
      &lt;/fragment&gt;
  
  
  
      &lt;fragment
          android:id="@+id/nav_search"
          android:name=".SearchFragment"
          android:label="@string/search" /&gt;
  
  &lt;/navigation&gt;
  </code></pre>
  
  <p>I feel like <code>HomeFragment</code> and <code>SettingsFragment</code> should be related somehow but I'm not sure how to define that.</p>
  
  <h2>main_drawer.xml</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;group android:checkableBehavior="single"&gt;
          &lt;item
              android:id="@id/nav_home"
              android:icon="@drawable/ic_home_white_24dp"
              android:title="@string/home" /&gt;
  
          &lt;item
              android:id="@id/nav_settings"
              android:icon="@drawable/ic_settings_white_24dp"
              android:title="@string/settings" /&gt;
      &lt;/group&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <h2>MainActivity</h2>
  
  <p>And then within <code>MainActivity</code>, I just set it up like this. I called <code>setupActionBarWithNavController</code>, but I also have to actually setup the nav drawer myself, and handle the <code>onNavigationItemSelected</code>.</p>
  
  <pre><code>private fun setupNavigation() {
      navController = findNavController(R.id.mainNavigationFragment)
      setupActionBarWithNavController(this, navController, drawer_layout)
  
      val toggle = ActionBarDrawerToggle(
                  this, drawer_layout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close)
          drawer_layout.addDrawerListener(toggle)
          toggle.syncState()
  
      nav_view.setNavigationItemSelectedListener(this)
  }
  
  override fun onNavigationItemSelected(item: MenuItem): Boolean {
      val current = navController.currentDestination.id
      if (item.itemId != current) {
          navController.navigate(item.itemId)
      }
  
      drawer_layout.closeDrawers()
      return true
  }
  </code></pre>
  
  <p>build.gradle</p>
  
  <pre><code>// Navigation
  implementation 'android.arch.navigation:navigation-fragment-ktx:1.0.0-alpha04'
  implementation 'android.arch.navigation:navigation-ui-ktx:1.0.0-alpha04'
  </code></pre>
  
  <p>Thanks.</p>