Skip to content

Instantly share code, notes, and snippets.

@ericntd
Created January 1, 2022 20:36
Show Gist options
  • Save ericntd/9a26bc0eee48a9d399b5e6adabf2fb1e to your computer and use it in GitHub Desktop.
Save ericntd/9a26bc0eee48a9d399b5e6adabf2fb1e to your computer and use it in GitHub Desktop.
Generic ViewModel Factory usage
@Inject
lateinit var viewModelFactory: GenericViewModelFactory<WeatherViewModel>
private val viewModel: WeatherViewModel by lazy {
ViewModelProvider(this, viewModelFactory).get(WeatherViewModel::class.java)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment