google-developer-training / android-fundamentals-apps-v2

Other
649 stars 2.63k forks source link

Android Kotlin Fundamentals codelab: #311

Closed frustr8dlec closed 1 year ago

frustr8dlec commented 2 years ago

Describe the problem A clear and concise description of what the problem is. Using Deprecated code calls In which lesson and step of the codelab can this issue be found?

All room view model examples are using async task (deprecated) Use of deprecated ViewModelProviders.of(this)

Lesson number + step number. Android fundamentals 10.1 Part A: Room, LiveData, and ViewModel All database code uses Async Task (Deprecated).

Android fundamentals 10.1 Part B: Deleting data from a Room database

How to reproduce? What are the exact steps to reproduce the problem? In Android fundamentals 10.1 Part B: Deleting data from a Room database

mWordViewModel = ViewModelProviders.of(this).get(WordViewModel.class);

should be

mWordViewModel = ViewModelProvider(this).get(WordViewModel.class);

Versions

  1. What version of Android Studio are you using? Android Studio Arctic Fox | 2020.3.1 Patch 4

  2. What API level are you targeting? minSdkVersion 28 targetSdkVersion 31

Additional information Add any other context about the problem here.

codelab: android-fundamentals