KotlinSyntax
Launch a Coroutine
Code example
scope.launch {
val data = load()
}Runs async work in a coroutine scope.
In Kotlin, launch a coroutine: runs async work in a coroutine scope — scope.launch { val data = load() }
scope.launch {
val data = load()
}scope.launch {
val data = load()
}Runs async work in a coroutine scope.
Use scope.launch { val data = load() }.
Use this pattern: scope.launch { val data = load() }
Yes. Use Copy code and adapt the example to your program.
No. The language syntax is the same across operating systems.