JSONObject,JSONArray取值

来源:互联网 发布:全国安全网络知识竞赛 编辑:程序博客网 时间:2024/06/04 20:08
result = HttpRequest.sendGet(url+pds.getString("eId"));     //从服务器取值

JSONObject newresult = JSONObject.fromObject(result);  //转为JSONObject 

JSONObject eventInfoData = (JSONObject)newresult.get("eventInfoData"); //取值

String doUserName = eventInfoData.getJSONArray("eventTasks").getJSONObject(0).getString("doUserName"); //从JSONArray中取出JSONObject 再取其中的值

0 1