I can not use the data from the method. I do not know why. Where did the mistake? I have the following json:
{"code":"1","status":"Basarili","login":"OK","kullanici":"1"}
JSONObject veri_json;
try {
veri_json = new JSONObject(response);
try {
String code,status,login,kullanici;
code = veri_json.getString("code").toString();
status = veri_json.getString("status").toString();
login = veri_json.getString("login").toString();
kullanici = veri_json.getString("kullanici").toString();
if(code=="1") {
etKullanici.setText(status);
}
}
catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Debugger note:
code="1" login="OK" status="Basarili" kullanici="1"
but doesn't work
if(code=="1") {
etKullanici.setText(status);
}
I am sorry for my bad English.