google-developer-training / basic-android-kotlin-compose-training-mars-photos

Solution code for Android Basics in Kotlin course
https://developer.android.com/courses/android-basics-kotlin/course?gclid=CjwKCAjw4c-ZBhAEEiwAZ105RTyT-iaLHzrhMBUXdMhO230ZDwOwxxI2x4RgK8DwBxK8t1h0wmU_QxoCi4YQAvD_BwE
Apache License 2.0
66 stars 58 forks source link

Add Repository Step 6 - 8 does not produce the same code as the solution code #25

Open tanin-t opened 1 year ago

tanin-t commented 1 year ago

URL of codelab: https://developer.android.com/codelabs/basic-android-kotlin-compose-add-repository?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-5-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-add-repository#5

Specify the language of the codelab if it is not English: English

In which task and step of the codelab can this issue be found?

  1. Open the MainActivity.kt file and create a variable viewModel of type MarsViewModel.jk
  2. This viewModel variable is populated by the call to the viewModel() function that is passed the MarsViewModel.Factory from the companion object as an argument to create the ViewModel.
  3. Update the code to pass variable viewModel as an argument to the MarsPhotosApp composable.

Describe the problem Step 6 - 8 does not produce the same code as the solution code and can not be run

Additional information This is code from codelab instruction Screen Shot 2566-01-07 at 09 20 45

This is the solution code Screen Shot 2566-01-07 at 09 21 05

gabriel-aquino-jr commented 1 year ago

I had the same problem. To solve it, include this parameter in the MarsPhotoApp

image