pilgr
07/26/2017, 12:25 PMkingsley
07/26/2017, 12:30 PMpilgr
07/26/2017, 1:12 PMrun
or launch
, still have a crash.
run(CommonPool + CoroutineExceptionHandler({ _, e ->
Log.e("TAG", "CoroutineExceptionHandler", e)
}))
kingsley
07/26/2017, 1:22 PMobject ExceptionHandler :
AbstractCoroutineContextElement(CoroutineExceptionHandler),
CoroutineExceptionHandler {
override fun handleException(context: CoroutineContext, exception: Throwable) {
Log.e(exception)
}
}
Then use it like:
launch(UI + ExceptionHandler) {
...
}
pilgr
07/26/2017, 1:42 PMrun
and launch
, didn’t put it initially in the right function. So problem solved, thanks!