У меня проблема при вызове двух разных API.Нет проблем при вызове первого API с использованием дооснащения, но когда он достигает второго дооснащенного вызова, возникает ошибка.Ниже приведен мой код.
//for first retrofit call:
apiInterface = ApiClient.getApiClient().create(LekhaDrillInterface.class);
Call<LekhaDrillModel> call = apiInterface.getData(id, memberId);
call.enqueue(new Callback<LekhaDrillModel>() {
@Override
public void onResponse(Call<LekhaDrillModel> call, Response<LekhaDrillModel> response) {
posts = Collections.singletonList(response.body());
adapter = new LekhaBolpatraDrillAdapter(posts, getApplicationContext());
rvLekhaDrill.setAdapter(adapter);
progressBar.setVisibility(View.GONE);
}
@Override
public void onFailure(Call<LekhaDrillModel> call, Throwable t) {
Log.e("error", t.getMessage());
}
});
здесь нет ошибки, и данные установлены в адаптере
//2nd retrofit call
private void callRetrofitListData(){
pariyojanaInterfaces = ApiClient.getApiClient().create(PariyojanaInterface.class);
Log.e("memberIDIDID", String.valueOf(memberId));
Call <Data> call1 = pariyojanaInterfaces.getData(memberId);
call1.enqueue(new Callback<Data>() {
@Override
public void onResponse(Call<Data> call, Response<Data> response) {
datas = (List<Data>) response.body();
if (response.body()!=null){
Log.d("jchhec","chekc");
}
itemListAdapter = new ItemListAdapter(getApplicationContext(), datas);
rv.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
rv.setAdapter(itemListAdapter);
}
@Override
public void onFailure(Call<Data> call1, Throwable t) {
Log.e("error", t.getMessage());
}
});
}
ошибка находится в строке
Call <Data> call1 = pariyojanaInterfaces.getData(memberId);
иошибка
Unable to create call adapter for interface retrofit2.Call for method PariyojanaInterface.getData
PariyojanaInterface.java
public interface PariyojanaInterface { @POST("projectBudget/pariyojanaListForMobile") Call getData(@Query("memberId") int memberId);
Кто-нибудь может помочь мне решить эту проблему?