Is it correct that `NavBackStackEntry.savedStateHa...
# compose
f
Is it correct that
NavBackStackEntry.savedStateHandle
is a complete different object from the
SavedStateHandle
object injected from Hilt in the corresponding route
ViewModel
?
i
Yes, they are completely different things
You can have many, many ViewModels with their own separate saved state handles for the same NavBackStackEntry
f
Got it. I was trying to handle the result back from another destination (
previousNavBackStackEntry.savedStateHandle.set()
) and I thought I could handle it in the view model through
savedHandleState.getLiveData()
. Anyway. I found your answer to another thread in which you linked the documentation page on how to properly handle a result back (https://developer.android.com/guide/navigation/navigation-programmatic#returning_a_result). Thank you very much for your time.
129 Views