Hello. Can someone explain how I can use suspended...
# android
s
Hello. Can someone explain how I can use suspended calls inside a
BroadcastReceiver
? Right now I am just using a
GlobalScope#launch
. Is there a different approach I should be using or is this it, should I manually cancel the
CoroutineScope
? Also if I am using this, should I use
BroadcastReceive#goAsync
and finish the
PendingResult
or will system automatically finishes the
BroadcastReceiver
?
Copy code
GlobalScope.launch(Dispatchers.Main) {
  // call suspended calls
}