is anyone else experiencing illegaArgumentExceptio...
# android
k
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
Try to delay the viewmodel initilzation, probably your navgraph is not fully restored.
k
Indeed one of my devs tried to access the viewmodel in the fragment's onCreate