我想问一下如何使用Retrofit从2个json文件中获取数据。Android Retrofit - 如何从2个json文件中获取数据
现在我有适用于一个URL的应用程序。
我的服务:
public interface TestService {
@GET(url1)
Call<Pojo> getArray();
}
进出口使用RecyclerView
Call<Pojo> getCall = mTestService.getArray();
getCall.enqueue(new Callback<Pojo>() {
@Override
public void onResponse(Response<Pojo> response, Retrofit retrofit) {
mRecyclerView.setAdapter(new TestAdapter(response.body()));
}
@Override
public void onFailure(Throwable t) {
}
});
,它工作正常,但我想文件从2个网址添加到RecyclerView。有任何想法吗?也许分页?从一个JSON加载数据后,加载第二个JSON?