Cross-posting from <#C0B8M7BUY|android>: <https://...
# coroutines
s
s
In onCreate, do a
async
instead of a
launch
. Remember the returned
Deferred<T>
. Then in the onResume, do an
await()
on that
Deferred<T>
.
This is a dirty/statefull way of doing this. Another cleaner (in my opinion) way is to use a Channel or a Mutex (Mutex from Coroutines)
s
Thanks @streetsofboston, those are some good pointers! I might go with the
async
to get through a deadline but will investigate the alternatives more when I have time!
Update: I went with a channel and it works great!
💯 1