幫妳解析部分吧,其他的模仿就行了,運行下試試看,記得導入包
JSONObject?jsonObject?=?JSONObject.fromObject("妳的JSON串");JSONArray?results?=?JSONArray.fromObject(jsonObject.get("results"));
for?(int?i?=?0;?i?<?results.size();?i++)?{
if(i?>?0)?{
break;
}
JSONObject?result?=?JSONObject.fromObject(results.get(i));
JSONObject?user?=?JSONObject.fromObject(result.get("user"));
System.out.println("gender:"?+?user.get("gender"));
JSONObject?name?=?JSONObject.fromObject(user.get("name"));
System.out.println("title:"?+?name.get("title"));
}