F
F
foonfyrick2020-10-22 09:29:46
Kotlin
foonfyrick, 2020-10-22 09:29:46

Coroutines, how to call async, await, launch functions?

I connected the libraries
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8"
I can only use CoroutineScope(), but the lessons say about async, await, launch... without any additions

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2020-10-22
@foonfyrick

async and launch can only be called on a scope, and await is a suspend function, it can only be called from other suspend functions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question