google-developer-training / android-kotlin-fundamentals-starter-apps

android-kotlin-fundamentals-starter-apps
Other
1.1k stars 3.32k forks source link

ViewModelProviders #24

Closed 2000Vlad closed 4 years ago

2000Vlad commented 4 years ago

As stated here : https://developer.android.com/reference/androidx/lifecycle/ViewModelProviders The ViewModelProviders class is deprecated. Instead of viewModel = ViewModelProviders.of(this).get(GameViewModel::class.java) you should use val provider = ViewModelProvider(this, ViewModelProvider.NewInstanceFactory() viewModel = provider.get(GameViewModel::class.java

android-dev-lxl commented 4 years ago

Fixed