我不知道爲什麼我在與解析這個簡單的JSON這麼多的問題:的Android解析JSON響應
{"status":0,"result":{"success":false,"message":"Error"}}
我怎麼會得到成功和消息字符串?
try {
river = response.getJSONArray("result");
// looping through All Contacts
for(int i = 0; i < river.length(); i++){
JSONObject c = river.getJSONObject(i);
if (c.has("message")) {
message = c.getString("message");
System.out.println("object_guid:"+message); }
if (c.has("success")) {
success = c.getString("success");
System.out.println("subtype:"+success); }
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}