Unable to clear the back stack of all fragments with Navigation Components
I am using the Android Navigation Components and am facing one weird issue. I am not able to clear the back stack for the up button, no matter what I tried. My Navigation graph looks like this: Let's take the LoginFragment for example, <fragment android:id="@+id/loginFragment" android:name="com.yashovardhan99.firebaselogin.LoginFragment" android:label="Login" tools:layout="@layout/fragment_login" > <action android:id="@+id/action_loginFragment_to_welcomeFragment" app:destination="@id/welcomeFragment" app:popUpTo="@+id/nav_graph" app:popUpToInclusive="true" /> </fragment> The Java code to