anthonyeef
03/27/2017, 3:04 AMfun <T> AnkoAsyncContext<T>.onComplete(f: (T?) -> Unit) {
val ref = weakRef.get()
if (ContextHelper.mainThread == Thread.currentThread()) {
f(ref)
} else {
<http://ContextHelper.handler.post|ContextHelper.handler.post> { f(ref) }
}
}
I know that there is actually a try catch
inside the method doAsync
, should I use onComplete
method like the finally
method in try catch
?