google-developer-training / android-basics-kotlin-cupcake-app

Apache License 2.0
103 stars 163 forks source link

Android Basics: Shared ViewModel #17

Closed rscova closed 3 years ago

rscova commented 3 years ago

URL of codelab https://developer.android.com/courses/pathways/android-basics-kotlin-unit-3-pathway-4#codelab-https://developer.android.com/codelabs/basic-android-kotlin-training-shared-viewmodel

In which task and step of the codelab can this issue be found? Task 2. Step 6. Update flavor with user choice

Describe the problem The provided code for adding a new variable in fragment_flavor.xml gives errors in Android Studio:

<data>
    <variable
        name="viewModel"
        type="com.example.cupcake.model.OrderViewModel" />
</data>

The correct code should be:

<data>
    <variable
        name="viewModel"
        type="com.example.cupcake.OrderViewModel" />
</data>

Versions Android Studio version: 4.2 API version of the emulator: