Issue
I am using the Android Navigation Component to handle the fragments.
I have Fragment A, B, C and E which can all open Fragment D (with a little different data).
On Fragment D you can then go either back or open another Fragment D with different data.
The user may click A->D->D->D->D->D and then back.
Is there a simple way to get back directly to A (or B, C, E whatever was the starting point) from D without going back all D calls?
I was hoping I could set parameters on the action arrows, but did not find any setting which worked.
Solution
That's exactly what the "Single Top" option does: only allows a single copy of that destination on the top of the back stack.
<action android:id="@+id/action_nav_detail_self"
app:destination="@id/nav_detail"
app:launchSingleTop="true"/>
Answered By - ianhanniballake
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.