Answers for "How to clear navigation stack after navigating to another fragment in Android"

1

How to clear navigation stack after navigating to another fragment in Android

inclusive boolean: true to also pop the given destination from 
the back stack So, I set the inclusive to false because I don't
want to pop the current fragment from the stack

<action
     android:id="@+id/action_loginFragment_to_employerMainFragment"
     app:destination="@id/employerMainFragment"
     app:popUpTo="@+id/loginFragment"
     app:popUpToInclusive="false"/>
Posted by: Guest on November-09-2021
1

How to clear navigation stack after navigating to another fragment in Android

navController.navigateUp();
Posted by: Guest on November-09-2021

Code answers related to "How to clear navigation stack after navigating to another fragment in Android"

Browse Popular Code Answers by Language