if I have three fragments A, B, C and A is the hom...
# android-architecture
m
if I have three fragments A, B, C and A is the home Fragment, how can I know if I’m coming from B or C when I press go back to A, using Navigation Component
f
I haven't seen any api in navigation component but you can use
savedStateHandle
liveData to set the result in B or C and listen in A. https://developer.android.com/guide/navigation/navigation-programmatic#returning_a_result Or you can use a shared view model which is scoped to nav graph. If you can give the use case, it would be better