Android ViewModel injections revisited
In one of our previous posts we have described how to implement a ViewModel factory that was able to provide ViewModels with their dependencies injected, e.g. an API client, and it was good enough for us at that time. Later on, thanks to Piotr, we’ve found out even better and simpler approach with an additional possibility of injecting Activity- or Fragment-dependant data into ViewModels.
Tags: android, explainlikeimfive, beginners, tips