Specify the language of the codelab if it is not English:
In which task and step of the codelab can this issue be found?
step4
Describe the problem
the parameter in the viewmodel has been forgeotten
i get an error in the follwing code since i need to specify the parameter
fun getMarsPhotos() {
viewModelScope.launch {
marsUiState = try {
//this line throws error since DefaultMarsPhotosRepository now has a parameter: MarsApiService
val marsPhotosRepository = DefaultMarsPhotosRepository()
val listResult = marsPhotosRepository.getMarsPhotos()
MarsUiState.Success("Success: ${listResult.size} Mars photos retrieved")
} catch (e: IOException) {
MarsUiState.Error
}
}
}
}
Steps to reproduce?
Go to...
Click on...
See error...
VersionsAndroid Studio version:API version of the emulator:
Additional informationInclude screenshots if they would be useful in clarifying the problem.
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#3
Specify the language of the codelab if it is not English:
In which task and step of the codelab can this issue be found? step4
Describe the problem the parameter in the viewmodel has been forgeotten i get an error in the follwing code since i need to specify the parameter
fun getMarsPhotos() { viewModelScope.launch { marsUiState = try {
}
Steps to reproduce?
Versions Android Studio version: API version of the emulator:
Additional information Include screenshots if they would be useful in clarifying the problem.