// <--------------------- 1.DERS------------------------>
{
String ders = "1";
Call request = ManagerAll.getInstance().turkcebirincisinif(sinif,ders,country);
request.enqueue(new Callback() {
@Override
public void onResponse(Call call, retrofit2.Response response) {
if (response.body().isDy()!=false) {
kazanim1.setText(response.body().getKazanim());
} else {
kazanim1.setText(response.body().getResult());
}
}
@Override
public void onFailure(Call call, Throwable t) {
}
});
}
// <--------------------- 1.DERS------------------------>
// <--------------------- 2.DERS------------------------>
{
String ders = "2";
Call request = ManagerAll.getInstance().turkcebirincisinif(sinif,ders, country);
request.enqueue(new Callback() {
@Override
public void onResponse(Call call, retrofit2.Response response) {
if (response.body().isDy()!=false) {
kazanim2.setText(response.body().getKazanim());
} else {
kazanim2.setText(response.body().getResult());
}
}
@Override
public void onFailure(Call call, Throwable t) {
}
});
}
// <--------------------- 3.DERS------------------------>
Bu kod bloğundan 30 tane var. Bunlar yenilenince 5 -6 defa hata oluşuyor yada iki sorguyu tek sorgu haline nasıl getirmeliyiz.