public void kelimeGetir(int degerB, final int kelimeSayi) {
AsyncHttpClient client = new AsyncHttpClient();
RequestParams params = new RequestParams();
params.put("degerB", degerB);
client.post("http://kafem.esy.es/kelimeGetirB.php", params, new TextHttpResponseHandler() {
@Override
public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
Toast.makeText(getApplicationContext(), "Lütfen internetinizi kontrol edin!", Toast.LENGTH_SHORT).show();
}
@Override
public void onSuccess(int statusCode, Header[] headers, String responseString) {
JSONObject object;
try {
object = new JSONObject(responseString);
JSONArray array = object.getJSONArray("kelimeler");
JSONObject kelime = array.getJSONObject(sayac);
ingKel.setText(kelime.get("ingK").toString());
turkKel.setText(kelime.get("turkK").toString());
ingOkun.setText(kelime.get("ingOk").toString());
kelimeS++;
sayac++;
kelSayisi.setText(kelimeSayi + "/10 Kelime");
} catch (JSONException e) {
e.printStackTrace();
}
}
});