【发布时间】:2020-07-15 19:15:41
【问题描述】:
我想使用改造同时拨打多个电话。当两个电话都结束时,我想用结果做点什么。
这是我的界面
public interface IService {
@GET("all")
Observable<Global> getGlobal();
@GET("countries")
Observable<Country> getCountries();
}
这是我的不完整代码
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://coronavirus-19-api.herokuapp.com/")
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJava3CallAdapterFactory.create())
.build();
IService api = retrofit.create(IService.class);
List<Observable<?>> requests = new ArrayList<>();
requests.add(api.getGlobal());
requests.add(api.getCountries());
【问题讨论】:
标签: android retrofit rx-java retrofit2 rx-java2