假设现在有这样一个 JSONObject
{
"data": {
"is_admin": false,
"app_id": 10,
"user": {
"id": "2xxxxx",
"phone": "186xxxxxx",
"area": "beijing",
"is_active": "1",
"is_admin": false,
}
},
"expire": 18000
}
System.out.println(responseJson);
String username = String.valueOf(responseJson.getJSONObject("data").getJSONObject("user").get("area"));
通过这种方式即可获取 area 的值