public void getApiCallToLoadData() {
Log.e("test","in method");
mService.getResponse().enqueue(new Callback<Example>() {
@Override
public void onResponse(Call<Example> call, Response<Example> response) {
Log.e("test", "success");
if(response.isSuccessful()) {
// mAdapter.updateAnswers(response.body().getItems());
Log.e("AnswersPresenter", "posts loaded from API");
mList = response.body().getVideoAPIResponse();
}else {
int statusCode = response.code();
// handle request errors depending on status code
}
}
@Override
public void onFailure(Call<Example> call, Throwable t) {
showErrorMessage();
Log.e("test", "error loading from API");
}
});
Log.e("test","out method");
}
Api成功命中并且我在我的改装日志中得到了响应,但它没有调用onresponse或onfailure方法。需要帮助。