title: Drawer layout with navigation component - Listener on only one item
body: <p>I've got an issue concerning the implementation of a Drawer Layout with Navigation component.</p>
  <p>I have created the drawer layout using the include Navigation Drawer Activity of Android Studio.</p>
  <p>Actually, all is fine if the menu items purpose is to change fragments or activity (like programs, songs, settings etc ... on the screenshot) define in the navigation XML</p>
  <p><a href="https://i.stack.imgur.com/3Vmig.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3Vmig.png" alt="All is fine --&gt; Fragments are changing" /></a></p>
  <pre><code>val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout)
      val navView: NavigationView = findViewById(R.id.nav_view)
      val navController = findNavController(R.id.nav_host_fragment)
      // Passing each menu ID as a set of Ids because each
      // menu should be considered as top level destinations.
      appBarConfiguration = AppBarConfiguration(
          setOf(
              R.id.nav_user_programs_list,
              R.id.nav_user_songs_list,
              R.id.nav_user_settings,
              R.id.nav_user_legal_notices,
              R.id.nav_games
          ), drawerLayout
      )
      setupActionBarWithNavController(navController, appBarConfiguration)
      navView.setupWithNavController(navController)
  </code></pre>
  <p>However, I also would like to execute a logout action on the &quot;logout&quot; menu item without launching another fragment or activity :</p>
  <p><a href="https://i.stack.imgur.com/U7bAT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/U7bAT.png" alt="Logout dialog clicking logout menuItem --&gt; No change of fragment " /></a></p>
  <p>I managed to do it like that :</p>
  <pre><code>navView.setNavigationItemSelectedListener {
          if (it.itemId == R.id.nav_logout) {
              logoutUser()
          }
          true
      }
  </code></pre>
  <p>But my problem is : With that method, all the other items which used to work (changing fragment) don't work anymore because it called the NavigationItemSelectedListener which do nothing in that case.</p>
  <p>Is there a solution to combine the both method ? :</p>
  <ul>
  <li>Changing fragment with the default drawer layout of android studio</li>
  <li>Using a NavigationItemSelectedListener to only execute an action on only one menuitem.</li>
  </ul>
  <p>I hope it's clear enough. Don't hesitate if you need precisions.</p>
  <p>Thank you very much.</p>