codelab-kotlin-coroutines icon indicating copy to clipboard operation
codelab-kotlin-coroutines copied to clipboard

Kotlin Coroutines codelab

Results 87 codelab-kotlin-coroutines issues
Sort by recently updated
recently updated
newest added
trafficstars

"What you'll do" contains "Learn techniques to convert existing APIs to coroutines using suspendCoroutine.", but that is not mentioned anywhere in the codelab.

https://codelabs.developers.google.com/codelabs/kotlin-coroutines/index.html?index=..%2F..index#5 Review the existing code Open MainViewModelTest.kt in the androidTest folder. It should be test folder instead.

On the _Using coroutines with WorkManager_ page (12), _Testing our CoroutineWorker_ section, where the code sample specifies imports as well as code, there are 3 imports which are duplicated. ```...

In the **advanced-coroutines-codelab** sample, you've used `ConflatedBroadcastChannel` to watch the `growZone` change. https://github.com/googlecodelabs/kotlin-coroutines/blob/b71b981f8354a92fb3ebda37eceb7461e783d0bf/advanced-coroutines-codelab/finished_code/src/main/java/com/example/android/advancedcoroutines/PlantListViewModel.kt#L91-L103 I've used same technique in one of my side projects, and when resuming the listening activity, sometimes...

not "Open MainViewModelTest.kt in the androidTest folder. " but "Open MainViewModelTest.kt in the test folder. "

interface MainNetwork { `@GET("next_title.json")` `suspend fun fetchNextTitle(): Result` } I tried returning a `Result` & got `'kotlin.Result' can not be used as a return type`

At the end of 5th step there are example of **MainViewModel.kt**: ``` // resume in the main dispatcher // _snackbar.value can be called directly from main thread _taps.postValue("$tapCount taps") ```...

![image](https://user-images.githubusercontent.com/734319/80165191-8d4b3800-85a0-11ea-831e-5a532686b082.png)

``` /** * Wait one second then update the tap count. */ private fun updateTaps() { // TODO: Convert updateTaps to use coroutines tapCount++ BACKGROUND.submit { Thread.sleep(1_000) _taps.postValue("$tapCount taps") }...

Wouldn't it be simpler to just use `LiveData.value` in the `com.example.android.kotlincoroutines.main.MainViewModelTest#whenMainClicked_updatesTaps` unit test? `getValueForTest()` seems a convoluted way to get to the same place. I understand it might be different...