This is a great question. The next frontier for using this ViewModel pattern with the AbstractSavedStateViewModelFactory, as you mention is injecting the ViewModel entirely.

AssistedInject seems to be a promising method of injecting the ViewModel with Dagger. AssistedInject is on my personal learning roadmap so stay tuned for more in the future.

Manuel Vivo has been publishing good content surrounding Dagger, and it seems like improvements to Dagger for Android are coming. I’d imagine a a simplified approach to injecting ViewModel’s to be a part of those updates.

--

--

Open Sourcer

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adam Hurwitz

Adam Hurwitz

Open Sourcer

More from Medium

Engineering the Mystery

How Shall I Compare Thee…

Nishtha’s Handmade — A testimony to the adage that it’s never too late to learn and begin…

SPEAK LESS, THINK MORE,