You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.
Describe the problem
The code used to initialise the ViewModel is depreciated.
viewModel = ViewModelProviders.of(this).get(GameViewModel::class.java)
In which lesson and step of the codelab can this issue be found?
Android Kotlin Fundamentals 05.1: ViewModel and ViewModelFactory
This code seems to work
viewModel = ViewModelProvider(this).get(GameViewModel::class.java)
Refer to StackOverflow:
https://stackoverflow.com/questions/53903762/viewmodelproviders-is-deprecated-in-1-1-0
How to reproduce?
Enter the code into Android Studio
Versions
Min: 19
Max: 28
Additional information
Add any other context about the problem here.
codelab: android-kotlin-fundamentals
The text was updated successfully, but these errors were encountered: