Я перешел на DialogFragment из Блок навигации , который подключен к NavController. Но когда я перехожу к другому месту назначения, которое я установил popUpTo и Inclusive of Dialog фрагмент, он не очищает стек. Как очистить стек?
AM, вызывающий этот метод из LogoutDialog
findNavController().navigate(R.id.action_logoutDialog_to_auth_navigation)
Использую фрагменты и только одно действие.
Это часть моего навигационного графика
<fragment
android:id="@+id/homeFragment"
android:name="io.ui.home.HomeFragment"
tools:layout="@layout/fragment_home" >
<action
android:id="@+id/action_homeFragment_to_auth_navigation"
app:destination="@id/auth_navigation"
app:popUpTo="@id/homeFragment"
app:popUpToInclusive="true" />
<argument
android:name="fromLogin"
app:argType="boolean"
android:defaultValue="false" />
</fragment>
<dialog
android:id="@+id/logoutDialog"
android:name="io.ui.dialog.LogoutDialog"
android:label="LogoutDialog" >
<action
android:id="@+id/action_logoutDialog_to_auth_navigation"
app:destination="@id/auth_navigation"
app:popUpTo="@id/logoutDialog"
app:popUpToInclusive="true" />
</dialog>
<!-- auth navigation graph -->
<navigation
android:id="@+id/auth_navigation"
app:startDestination="@id/loginFragment">
<fragment
android:id="@+id/loginFragment"
android:name="io.ui.login.LoginFragment"
android:label="fragment_login"
tools:layout="@layout/fragment_login">
<action
android:id="@+id/action_loginFragment_to_OTPFragment"
app:destination="@id/OTPFragment"
app:popUpTo="@id/loginFragment"
app:popUpToInclusive="true" />
<action
android:id="@+id/action_loginFragment_to_homeFragment"
app:destination="@id/homeFragment" />
<action
android:id="@+id/action_loginFragment_to_resetPasswordFragment"
app:destination="@id/resetPasswordFragment" />
</fragment>
<fragment
android:id="@+id/OTPFragment"
android:name="io.ui.login.OTPFragment"
android:label="fragment_otp"
tools:layout="@layout/fragment_otp">
<action
android:id="@+id/action_OTPFragment_to_homeFragment"
app:destination="@id/homeFragment"
app:popUpTo="@id/OTPFragment"
app:popUpToInclusive="true" />
<action
android:id="@+id/action_OTPFragment_to_loginFragment"
app:destination="@id/loginFragment"
app:popUpTo="@id/OTPFragment"
app:popUpToInclusive="true" />
</fragment>
<fragment
android:id="@+id/resetPasswordFragment"
android:name="io.ui.profile.PasswordFragment"
android:label="fragment_reset_password"
tools:layout="@layout/fragment_password" >
<argument
android:name="isReset"
app:argType="boolean"
android:defaultValue="false" />
</fragment>
</navigation>