What would be the cause of this error? `Can't access ViewModels from detached fragment` EDIT: I fixe...
n
What would be the cause of this error?
Can't access ViewModels from detached fragment
EDIT: I fixed it by using
by viewModel()
instead of
= getViewModel()
d
from a brief google search shows that you can’t load a viewmodel using a fragment that hasn’t called onAttach
513 Views