1 min readSep 4, 2019
Nice solution Bryan Okeke. Thanks for sharing the implementation details!
For more concise code this may be implemented with Kotlin as in Mohit Sharma’s sample, Android ViewModel with Custom Arguments. With this strategy the CryptoTrackerViewModelFactory
class constructor is not required when overriding ViewModelProvider.NewInstanceFactory
.