public class ModelSearchMoon {
List<ModelSearchMoon> modelSearchMoons;
public List<ModelSearchMoon> getModelSearchMoons() {
return modelSearchMoons;
}
public void setModelSearchMoons(List<ModelSearchMoon> modelSearchMoons) {
this.modelSearchMoons = modelSearchMoons;
}
public int getModelSearchMoonsSize() {
return modelSearchMoons.size();
}
}
public class ModelSearchMoon {
@Expose
private List<Upd> updates;
public List<Upd> getUpdates() {
return updates;
}
public void setUpdates(List<Upd> updates) {
this.updates = updates;
}
public int getSizeUpdates() {
return updates.size();
}
public class Upd {
@SerializedName("kinopoisk_id")
private int kinopoisk_id;
@SerializedName("added_at")
private String added_at;
public int getKinopoisk_id() {
return kinopoisk_id;
}
public void setKinopoisk_id(int kinopoisk_id) {
this.kinopoisk_id = kinopoisk_id;
}
public String getAdded_at() {
return added_at;
}
public void setAdded_at(String added_at) {
this.added_at = added_at;
}
}
}
call.enqueue(new Callback<ModelSearchMoon>() {
@Override
public void onResponse(Call<ModelSearchMoon> call, Response<ModelSearchMoon> response) {
if (response.body().getSizeUpdates()>0) {
for (int r = 0; r < response.body().getSizeUpdates(); r++) {
final int kpID = response.body().getUpdates().get(r).getKinopoisk_id();
Log.d("TEST", "kpID="+kpID);
}
}
}
@Override
public void onFailure(Call<ModelSearchMoon> call, Throwable t) {
}
});
call.enqueue(new Callback<ModelSearchMoon>() {
@Override
public void onResponse(Call<ModelSearchMoon> call, Response<ModelSearchMoon> response) {
final int kpID = response.body().getKinopoisk_id();
Log.d("TEST", "kpID="+kpID);
}
@Override
public void onFailure(Call<ModelSearchMoon> call, Throwable t) {
}
});
LinearLayout.LayoutParams linLayoutParam = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
View viewRezult = getLayoutInflater().inflate(R.layout.share_view, null, false);
LinearLayout shareRezult = (LinearLayout) viewRezult.findViewById(R.id.linRezult);
shareRezult.setLayoutParams(linLayoutParam);
shareRezult.setDrawingCacheEnabled(true);
shareRezult.buildDrawingCache(true);
Bitmap bm = shareRezult.getDrawingCache();