private Disposable disposeInUiThread(final Action action) {
return Disposables.fromAction(new Action() {
@Override public void run() throws Exception {
if (Looper.getMainLooper() == Looper.myLooper()) {
action.run();
} else {
final Scheduler.Worker inner = AndroidSchedulers.mainThread().createWorker();
inner.schedule(new Runnable() {
@Override public void run() {
try {
action.run();
} catch (Exception e) {
onError("Could not unregister receiver in UI Thread", e);
}
inner.dispose();
}
});
}
}
});
}
PreLollipopNetworkObservingStrategy.java 文件源码
java
阅读 41
收藏 0
点赞 0
评论 0
项目:Rx_java2_soussidev
作者:
评论列表
文章目录