从错误中可以明显看出,您正在尝试将Json Object转换为Json数组。那不应该。
这是读取您的JSON响应的代码。
String json = "Assuming that here is your JSON response"; try { JSonObject parentObject = new JSonObject(json); JSonObject userDetails = parentObject.getJSonObject("user_details"); //And then read attributes like String name = userDetails.getString("user_name"); String phone = userDetails.getString("user_phone"); String id = userDetails.getString("ref_id");} catch (JSonException e) { // TODO Auto-generated catch block e.printStackTrace();}上面的代码用于
{"user_details":{"user_id":"1","user_name":"chand","user_phone":"9620085675","ref_id":6386}}JSON。


