{"info":-[-{"success":true,
"object":-[-{"id":"743",
"pagetitle":"\u041a\u044d\u0448-\u042e",
"price":"7000-12000",
"titleCat":"\u0420\u0435\u0441\u0442\u043e\u0440\u0430\u043d\u044b",
"map":"43.225252604744355,76.95571602834801",
"img":"assets\/uploads\/97\/2016-09-04_11-00-22_2.jpg",
"halal":"1",
"isAkc":"",
"address":"\u0433.\u0410\u043b\u043c\u0430\u0442\u044b, \u0425\u0430\u0434\u0436\u0438 \u041c\u0443\u043a\u0430\u043d\u0430 43, \u0443\u0433 \u041c\u0435\u0434\u0438\u043a\u0443\u043b\u043e\u0432\u0430.",
"work-day":"\u043f\u043d-\u0447\u0442 \u0441 10:00 \u0434\u043e 01:00 \u043f\u0442-\u0441\u0431 \u0441 11:00 \u0434\u043e 02:00",
"rating":"5"
},
_
@GET("?act=object&cid=10&sort=1")
Call<ResturantResponse> getResturantList();
public class ResturantResponse {
@SerializedName("object")
private List<Resturant> object;
public List<Resturant> getObject() {
return object;
}
public void setObject(List<Resturant> object) {
this.object = object;
}
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
final RecyclerView recyclerView = (RecyclerView)view.findViewById(R.id.recycler_view_resturant);
ApiInterface apiInterface = ApiClient.getClient().create(ApiInterface.class);
Call<ResturantResponse> call = apiInterface.getResturantList();
call.enqueue(new Callback<ResturantResponse>() {
@Override
public void onResponse(Call<ResturantResponse> call, Response<ResturantResponse> response) {
List<Resturant> resturants = response.body().getObject();
recyclerView.setAdapter(new ResturantAdapter(resturants,R.layout.card_view_resturant,getActivity().getApplicationContext()));
}
@Override
public void onFailure(Call<ResturantResponse> call, Throwable t) {
Log.e("resturant",t.toString());
}
});
}
я так написал Response но ответ пустой.