title: Android Navigation Component Activity Intent Flags
body: <p>I have created a navigation action from a fragment to an activity, but I have no way of clearing the back stack. When I execute the navigation action from my fragment to my new activity, and I press the back button, I am taken back to the previous activity and previous fragment. I have no way of setting Intent flags, using the navigation graph, to clear the previous activity from the back stack. </p>
  
  <pre><code>&lt;fragment
      android:id="@+id/loginFragment"
      android:name="com.myapp.auth.LoginFragment"
      android:label="login_fragment"
      tools:layout="@layout/login_fragment" &gt;
      &lt;action
          android:id="@+id/action_loginFragment_to_webActivity"
          app:destination="@id/webActivity"
          app:popUpTo="@id/loginFragment"
          app:popUpToInclusive="true" /&gt;
  &lt;/fragment&gt;
  &lt;activity
      android:id="@+id/webActivity"
      android:name="com.myapp.web.WebActivity"
      android:label="activity_web"
      tools:layout="@layout/activity_web" &gt;
  &lt;/activity&gt;
  </code></pre>
  
  <p><strong>PopTo</strong> and <strong>Inclusive</strong> flags have no effect on the back button when navigating from a fragment to a new activity, even though they can be set in the graph editor. I am able to navigate, using the back button, to the previous activity that I no longer want in the stack.</p>
  
  <p>Before migrating to the navigation graph, I could just specify this behavior with Intent flags:</p>
  
  <pre><code>intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
  </code></pre>
  
  <p>How can I achieve the same thing with the navigation graph?</p>