I'm working on an app where users can create events. I would like to make it so that the after they create the event the back button would not take them to the creation flow, but to the screen before the creation flow. Something like:
Main Screen -> Creation Flow -> Event Summary
Then if they press the back button I want it to go
Event Summary (back button) Main Screen
I've gotten close with:
<fragment
android:id="@+id/createMeetFragment"
android:name=".CreateMeetFragment"
android:label="CreateMeetFragment" >
<action
android:id="@+id/action_createMeetFragment_to_meet_detail_graph"
app:destination="@id/meet_detail_graph"
app:popUpTo="@+id/mainFragment" />
</fragment>
This works well enough in that it will pop-up to the Main screen. I haven't found much documentation for these pop behavior options just this.
The issue I have with this solution is that as I understand it, it will pop until we get to the MainScreen, regardless of how the user got to the event creation. I'd prefer a solution that just pops to the screen before the creation flow, allowing for multiple entry points to the creation flow.
I'd prefer a solution that just pops to the screen before the creation flow, allowing for multiple entry points to the creation flow.
You should not pop up to the main screen but to the first screen of creation flow inclusively.
<fragment
android:id="@+id/createMeetFragment"
android:name=".CreateMeetFragment"
android:label="CreateMeetFragment" >
<action
android:id="@+id/action_createMeetFragment_to_meet_detail_graph"
app:destination="@id/meet_detail_graph"
app:popUpTo="@+id/firstCreateFlowFragment"
app:popUpToInclusive="true" />
</fragment>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With