Here is the Response I wonder how can I handle a JSON Response like this? This a JSONArray, but didn't have a name Here is the response:
[[84,"sinat","qq357068756@163.com"],[88,"msn","qq357068756@hotmail.com"],[89,"163t","qq357068756@hotmail.com"],[90,"mail","qq357068756@hot开发者_如何学JAVAmail.com"],[93,"mail","qq357068756@163.com"]]
Data are not JSONObject
but JSONArray
!
String json_value = '[[84,"sinat","qq357068756@163.com"],[88,"msn","qq357068756@hotmail.com"],[89,"163t","qq357068756@hotmail.com"],[90,"mail","qq357068756@hotmail.com"],[93,"mail","qq357068756@163.com"]]';
JSONArray json_array = new JSONArray(json_value);
and walk through it like
for(int i = 0; i < json_array.length(); i++){
Log.d("Current index: "+i,"Current value: "+json_array.getJSONArray(i).toString());
}
精彩评论