I am going FragmentA->FragmentB. Now From FragmentB I want to pass data to FragmentA.So How can I do that??
Currently am going FragmentB->FragmentA with getCus
If using Kotlin, and android navigation architecture, you can use like this, from Navigation 2.3.0-alpha02 release.
Set result on Fragment B:
findNavController().previousBackStackEntry?.savedStateHandle?.set("key", result)
Observe the result on Fragment A, with same key:
findNavController().currentBackStackEntry?.savedStateHandle?.getLiveData("key")?.observe(
viewLifecycleOwner) {result ->
// Do something with the result.
}