Looking for a clean way to do it without passing c...
# android
p
Looking for a clean way to do it without passing context to the viewModel
s
I think passing application context should be fine.
p
Isn’t that a bad practice
I believe the viewModel shouldn’t hold reference to Android classes like activity and context etc
s
have you seen
AndroidViewModel
?
p
Let me check that out
s
activity and its context is bad practice because it will cause leaks. passing application should be fine.
p
Okay cool
s
application will outlive viewModels anyway.