Zun
12/04/2021, 2:04 PMinit
?Scott Kruse
12/04/2021, 3:25 PMZun
12/04/2021, 3:44 PMIan Lake
12/04/2021, 10:40 PMSavedStateHandle
as per this issue: https://github.com/google/dagger/issues/2287hiltViewModel
looks at the LocalViewModelStoreOwner
. Within a composable
destination, that would be its NavBackStackEntry
. Each NavBackStackEntry
has the set of arguments parsed from your route - those are passed through to Hilt's ViewModelFactory which is based on a `SavedStateViewModelFactory`: https://developer.android.com/reference/androidx/lifecycle/SavedStateViewModelFactorydefaultArgs
- that's what populates the SavedStateHandle
with the arguments from your NavBackStackEntry
Zun
12/05/2021, 4:25 PM