Android 导航Jetpack如何导航到原始片段
我有3个片段:导航主页-->绘制请求-->绘制确认 一切都很好。除第一个周期后外,导航主页直接进入绘图确认。这就是顺序: 导航主页-->绘图请求-->绘图确认-->导航主页-->绘图确认 我想要的是: 导航主页-->绘图请求-->绘图确认-->导航主页-->绘图请求Android 导航Jetpack如何导航到原始片段,android,navigation,android-jetpack,android-jetpack-navigation,Android,Navigation,Android Jetpack,Android Jetpack Navigation,我有3个片段:导航主页-->绘制请求-->绘制确认 一切都很好。除第一个周期后外,导航主页直接进入绘图确认。这就是顺序: 导航主页-->绘图请求-->绘图确认-->导航主页-->绘图确认 我想要的是: 导航主页-->绘图请求-->绘图确认-->导航主页-->绘图请求 如何在代码中导航?可能是包含了某些状态,因此draw_请求会自动再次调用导航…显示导航图的代码。您可能需要对从draw_confirmation到nav_Home的操作请求poputo=draw_刚才添加了code@pdegand
如何在代码中导航?可能是包含了某些状态,因此draw_请求会自动再次调用导航…显示导航图的代码。您可能需要对从draw_confirmation到nav_Home的操作请求poputo=draw_刚才添加了code@pdegand59我在最后一个片段中添加了popUpTo和PopuptInclusive,但仍然不起作用。
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/navigation_main_graph"
app:startDestination="@id/nav_home">
<fragment
android:id="@+id/nav_home"
android:name="com.enova.cashnet.ui.main.home.HomeFragment"
tools:layout="@layout/fragment_main_home">
<action
android:id="@+id/action_nav_home_to_draw_request"
app:destination="@id/draw_request" />
</fragment>
<fragment
android:id="@+id/draw_request"
android:name="com.enova.cashnet.ui.draw.request.DrawRequestFragment"
tools:layout="@layout/fragment_draw_request">
<action
android:id="@+id/action_draw_request_to_draw_confirmation"
app:destination="@id/draw_confirmation" />
</fragment>
<fragment
android:id="@+id/draw_confirmation"
android:name="com.enova.cashnet.ui.draw.confirmation.DrawConfirmationFragment"
tools:layout="@layout/fragment_draw_confirmation">
<argument
android:name="drawRequestResponseBody"
app:argType="com.enova.cashnet.model.DrawRequestResponseBody" />
<action
android:id="@+id/action_draw_confirmation_to_nav_home"
app:destination="@id/nav_home"
app:popUpTo="@+id/nav_home"
app:popUpToInclusive="true"/>
</fragment>
</navigation>
private fun onAccountSummaryDrawTapped() {
accountSummaryLOCCard?.btn_cta?.findNavController()?.navigate(R.id.action_nav_home_to_draw_request)
}