当我在拥有 Flowable Data 时卡住了,如何在 RxJava2 中发出后续请求?
How to make sequently requests in RxJava2 as I stuck when having Flowable Data?
我正在向服务器添加项目,如果成功,我收到的消息是空的,如果成功,我需要发出另一个请求。
我认为地图部分不是正确的选择,当我想将数据列表设置为适配器时,我卡住了,因为我需要简单数据时接收 Flowable 数据。
@POST("data”)
Single<Response<Void>> addData(@Body Info body);
@GET("otherData”)
Flowable<List<OtherData>> items();
repository.addData(body)
.map(new Function<Response<Void>, Flowable<List<OtherData>>>() {
@Override
public Flowable<List<OtherData>> apply(@NonNull Response<Void> voidResponse) throws Exception {
return repository.items();}
}).
.subscribe(items -> {
//set to adapter I need not Flowable, need simple list
});
我正在向服务器添加项目,如果成功,我收到的消息是空的,如果成功,我需要发出另一个请求。 我认为地图部分不是正确的选择,当我想将数据列表设置为适配器时,我卡住了,因为我需要简单数据时接收 Flowable 数据。
@POST("data”)
Single<Response<Void>> addData(@Body Info body);
@GET("otherData”)
Flowable<List<OtherData>> items();
repository.addData(body)
.map(new Function<Response<Void>, Flowable<List<OtherData>>>() {
@Override
public Flowable<List<OtherData>> apply(@NonNull Response<Void> voidResponse) throws Exception {
return repository.items();}
}).
.subscribe(items -> {
//set to adapter I need not Flowable, need simple list
});