YASAN
04/15/2021, 6:20 PMval parentViewModel = hiltNavGraphViewModel<ParentViewModel>("Parent")
but no matter what I do it imports the wrong hiltNavGraphViewModel which takes backStackEntry as a param and does not work in the end.
When I type hiltNavGraphViewModel I can see the option for the one that has a String param but even after I select it and Android Studio auto completes the code to
hiltNavGraphViewModel(route = )
it is still the one that requires backStackEntry and route is redIan Lake
04/15/2021, 6:33 PMNavController
- you have to do navController.hiltNavGraphViewModel<ParentViewModel>("Parent")
Ian Lake
04/15/2021, 6:35 PMNavController
is how it gets the right NavBackStackEntry
for the route (using the navController.getBackStackEntry(route)
method)Ian Lake
04/15/2021, 6:39 PMYASAN
04/15/2021, 6:41 PMYASAN
04/15/2021, 6:42 PMYASAN
04/15/2021, 6:42 PM