我有一个方法,允许我从服务器接收事件
getCamera.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.flatMap(Observable::fromIterable)
.flatMap(Observable::fromIterable)
.flatMap(events -> getApiMethods.getEvents(events.getAccessPoint().replace("hosts","")))
.flatMap(Observable::fromIterable)
.subscribe(new Observer<Event>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull Event event) {
Log.d ("RXJAVA", event.getType() + " " + event.getId() + " " + event.getTimestamp());
}
@Override
public void onError(@NonNull Throwable e) {
Log.d ("RXJAVA", String.valueOf(e));
}
@Override
public void onComplete() {
}
});
但是我想改变它,这样flatmap的中间查询结果就可以使用了。我怎么能做到这一点呢?谢谢
暂无答案!
目前还没有任何答案,快来回答吧!