is anyone else experiencing illegaArgumentException for
HiltNavGraphViewModel
initialization of a viewmodel when triggering a dark/light theme change or app locale change? The recreation of the activity and fragment seems to cause a crash when using lifecycle 2.8.2 with
HiltNavGraphViewModel
. It states that my current destination is null when calling
getBackStackEntry
under the hood.
not kotlin but kotlin colored 1
r
Rafael Moreira
06/19/2024, 12:00 AM
Try to delay the viewmodel initilzation, probably your navgraph is not fully restored.
k
Kenneth Leong
06/19/2024, 11:57 AM
Indeed one of my devs tried to access the viewmodel in the fragment's onCreate