参考资料:https://github.com/ReactiveX/RxJava/wiki/Error-Handling
// 捕捉RxJava全局异常
RxJavaPlugins.setErrorHandler(new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
Toast.makeText(context, throwable.getMessage(), Toast.LENGTH_SHORT).show();
}
});
网友评论