I have A, B, C, D fragments on Activity 1. When I ...
# navigation-architecture-component
a
I have A, B, C, D fragments on Activity 1. When I want to navigate to Activity 2 from Fragment D, I also needed to clear the nav back stack from D till A at that point. Also, Activity 2 will return some results to Activity 1. In fragment D, I am calling popBackStack before start activity for result as
Copy code
view?.findNavController()?.popBackStack(R.id.dashboard_fragment, false) // pop the stack till home.
and doing this right after above line
Copy code
activity?.startActivityForResult(intent, HomeActivityRequestCode)
the problem here is I get view of Fragment A (dashboard fragment) for a second while starting Activity 2 from Fragment D. How can I avoid the view of Fragment A when going from Fragment D to Activity 2. Note: I am using activity for results currently if there is some better approach other than that, please do help me with that.