0

I have 3 fragments: nav_home --> draw_request --> draw_confirmation

Everything works great. Except after 1 st cycle, the nav_home goes to draw_confirmation directly. So this is the sequence: nav_home --> draw_request --> draw_confirmation --> nav_home --> draw_confirmation

What I want is: nav_home --> draw_request --> draw_confirmation --> nav_home --> draw_request .....

enter image description here

<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>

Code to open draw_request:

private fun onAccountSummaryDrawTapped() {
        accountSummaryLOCCard?.btn_cta?.findNavController()?.navigate(R.id.action_nav_home_to_draw_request)
    }
nsutanto
  • 93
  • 3
  • 9

0 Answers0