KotlinLeaner
05/10/2023, 10:00 AMGlobalScope
is good option when we want to configure something in the application start?
GlobalScope.launch {
withTimeout(60000) { // 1 minute
// code in here
}
}
streetsofboston
05/10/2023, 12:21 PMNino
05/10/2023, 1:16 PMrunBlocking
instead of GlobalScope.launch
. This will block the current thread until the coroutine is finished.KotlinLeaner
05/10/2023, 1:26 PMrunBlocking
to GlobalScope
because it blocks the UI in launchscreen.GlobalScope
cannot be cancelled so how it will stop?streetsofboston
05/10/2023, 1:29 PMKotlinLeaner
05/10/2023, 1:30 PMgildor
05/13/2023, 2:54 PM