android / codelab-kotlin-coroutines

Kotlin Coroutines codelab
Apache License 2.0
552 stars 268 forks source link

Mistake in lab Section5. Controlling the UI with coroutines. #75

Open aleontsev opened 4 years ago

aleontsev commented 4 years ago
/**
* 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")
   }
}

".... One second after the user clicks the main view, it requests a snackbar. " Shoul be "One second after the user clicks the main view, it updates number of taps. "