I have 4 Fragments , A, B,C.Fragment A will be the main Fragment, I will be navigating from fragment A to Fragment B then Fragment B return with a result to fragment A. Then I will navigate To fragment C from fragment A, and fragment c will do some operations and return a result to fragment A. Each time the fragment A will show and keep the result returned from each fragment
The navigation between fragment A to the other fragment is implemented using this code
val bundle = Bundle()
bundle.putBoolean("data", true)
findNavController().navigate(R.id.myAction, toVoicePassphraseRecognitionbundle)
My problem her is that to return to fragment A, i also use findNavController().navigate()but doing so will create a new fragment that will be added to the stack, so my question is how can i navigate back from fragment B to A, or C to A while keeping the view state as it is without creating a new Fragment A.