title: Prevent circular navigation logic in BottomNavigationView using Navigation component
body: <p>I have a <code>BottomNavigationView</code> hooked up to 3 fragments (A, B and C) via the <a href="https://developer.android.com/guide/navigation/navigation-getting-started" rel="nofollow noreferrer">Navigation</a> component. I also have a login fragment, which I am popping off the stack after successful login.</p>
  
  <p><strong><em>Observed navigation behavior:</em></strong></p>
  
  <p>A > B > C > A > B > C > B > <em>Back</em> > C > <em>Back</em> > B > <em>Back</em> > A >  <em>Back</em> > <em>Exit</em></p>
  
  <p><strong><em>Expected behavior:</em></strong></p>
  
  <p>(after reading comments of @ianhanniballake and <a href="https://developer.android.com/guide/navigation/navigation-principles" rel="nofollow noreferrer">Principles of navigation</a>)</p>
  
  <p>A > B > C > A > B > C > B > <em>Back</em> > A >  <em>Back</em> > <em>Exit</em></p>
  
  <p>My problem is similar to <a href="https://developer.android.com/guide/navigation/navigation-getting-started#popupto_example_circular_logic" rel="nofollow noreferrer">circular navigation logic</a>, but I have it in the <code>BottomNavigationView</code>. How to achieve my expected behavior?</p>
  
  <p><strong>main_nav.xml</strong></p>
  
  <pre><code>&lt;navigation xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/main_nav"
      app:startDestination="@id/login_fragment"&gt;
  
      &lt;fragment
          android:id="@+id/login_fragment"
          android:name="com.example.app.LoginFragment"
          android:label="Login"&gt;
  
          &lt;action
              android:id="@+id/login_action"
              app:destination="@id/home_fragment"
              app:launchSingleTop="true"
              app:popUpTo="@id/main_nav"
              app:popUpToInclusive="true" /&gt;
  
      &lt;/fragment&gt;
  
      &lt;!-- Fragments A, B and C tied to BottomNavigationView--&gt;
  
  &lt;/navigation&gt;
  </code></pre>
  
  <p><strong><code>BottomNavigationView</code> setup</strong></p>
  
  <pre><code>navController = findNavController(R.id.main_nav_host)
  mainActivityBinding.bottomNavView.setupWithNavController(navController)
  </code></pre>