RXjava 线程调度问题 对比了源码 直接复制过来也会报错
来源:7-8 同意添加好友消息

旅途ing
2021-10-27
RXjava 线程调度问题
报错
RxJava:io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | org.litepal.exceptions.DatabaseGenerateException: can not find a class named com.test.model.Reader
disposable = Observable.create(new ObservableOnSubscribe<List>() {
@Override
public void subscribe(@NonNull ObservableEmitter<List> emitter) throws Exception {
emitter.onNext(LitePalHelper.getInstance().queryNewFriend());
emitter.onComplete();
}
}).subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<List>() {
@Override
public void accept(List newFriends) throws Exception {
if (!StringUtils.isEmpty(newFriends)) {
mList.addAll(newFriends);
mNewFriendAdapter.notifyDataSetChanged();
}else {
showViewStub();
mNewFriendView.setVisibility(View.GONE);
}
}
});
写回答
1回答
-
刘某人
2021-11-19
在Application中有个捕获全局异常的方法,也要添加下
00
相似问题