Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CoroutineContextExample {
- fun doSomeBackgroundWork() = CoroutineScope(Dispatchers.IO).launch {
- for (i in 1..5) {
- delay(2000L)
- withContext(Dispatchers.Main) {
- println("Value: $i")
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement