Dmytro TOLSTYI
01/21/2019, 7:50 AMsuspend
function which I can't solve: I got function suspend fun one()
which executes some code and then calls a function that accepts a callback function as a param. But, this param function is not suspend. The issue is that I need to call another suspend fun from that callback param function. Here's an example:
suspend fun one() {
doSomething()
funWithNonSuspendCallback("data") {
two() // I need to call it from here but this is not suspend scope anymore
}
}
suspend fun two() {
}
Andreas Sinz
01/21/2019, 7:53 AMDmytro TOLSTYI
01/21/2019, 7:57 AMNikky
01/21/2019, 8:38 AM