Has anyone dealt with "synchronizing" coroutines a...
# android
s
Has anyone dealt with "synchronizing" coroutines across Android lifecycle events? For example:
Copy code
onCreate(...) {
    scope.launch {
        asyncThing()
    }
}

onResume(...) {
    scope.launch {
        // code that depends on asyncThing() having completed
    }
}
Is there a way to "join" such that the onResume work does not start until the
asyncThing
is done?
k
Or perhaps just keep the result of the initial
scope.launch
and
join
it in onResume
s
Thanks @kingsley 😄
👍 1