ribesg
09/17/2020, 3:23 PMKris Wong
09/17/2020, 3:51 PMribesg
09/17/2020, 4:14 PMribesg
09/17/2020, 4:15 PMKris Wong
09/17/2020, 4:33 PMrudolf.hladik
09/30/2020, 1:03 PMe5l
09/30/2020, 1:04 PMlaunch {}
?louiscad
09/30/2020, 1:04 PMCoroutineExceptionHandler
, it might be the cause of the issue.louiscad
09/30/2020, 1:05 PMrudolf.hladik
09/30/2020, 1:08 PMrudolf.hladik
09/30/2020, 1:12 PMsuspend fun getDevice(onSuccess: (Device) -> Unit): Unit = withContext(workerDispatcher) {
launch {
val device = HttpClient().use { httpClient ->
httpClient.get<String>(url)
.let { response ->
json.decodeFromString(Device.serializer(), response)
}
}
onSuccess(device)
}
}
louiscad
09/30/2020, 1:13 PMDispatchers.Main
?rudolf.hladik
09/30/2020, 1:15 PMwithContext(Dispatchers.Main)
ribesg
09/30/2020, 2:01 PMrudolf.hladik
09/30/2020, 5:45 PMlouiscad
09/30/2020, 5:46 PMKris Wong
09/30/2020, 5:47 PMlouiscad
09/30/2020, 5:47 PMKris Wong
09/30/2020, 5:47 PMKris Wong
09/30/2020, 5:47 PMrudolf.hladik
09/30/2020, 5:48 PMKris Wong
09/30/2020, 5:48 PMrudolf.hladik
09/30/2020, 5:49 PMKris Wong
09/30/2020, 5:51 PMrudolf.hladik
09/30/2020, 5:52 PMlouiscad
09/30/2020, 6:45 PM