android JSONArray JSONObject 字符串转json数组 遍历json对象
2016-11-29 15:39
585 查看
String json = "{''data'':[{''name'':''Wallace''},{''name'':''Grommit''}]}"; StringBuffer marketXml = new StringBuffer(); jsonObjSplit = new JSONObject(json ); JSONArray ja = jsonObjSplit.getJSONArray("data'"); for (int i = 0; i < ja.length(); i++) { JSONObject jo = (JSONObject) ja.get(i); marketXml.append(jo.get(''name'")); System.out.println(marketXml.toString()); } -------------------------------------------------------------------------遍历json 对象 jsonObj = new JSONObject(activeMarketRet); for (Iterator iter = jsonObj.keys(); iter.hasNext();) { //先遍历整个 people 对象 String key = (String)iter.next(); System.out.println(jsonObj .getString(Key)); }
相关文章推荐
- JSONObject和JSONArray遍历数组与对象
- web服务端使用JSONArrayy或JSONObject转json字符串为Java对象或数组
- JSONObject和JSONArray遍历数组与对象
- 使用json-lib遍历数组与对象(JSONArray与JSONObject)
- jsonArray遍历 取出数组中对象
- json 字符串包含数组转换为object对象是报异常java.lang.ClassCastException: net.sf.ezmorph.bean.MorphDynaBean cannot be cast to
- Android进步之十四:使用jackon的ObjectMapper的writeValueAsString方法可以把java对象转化成json字符串
- android 读取json数据(遍历JSONObject和JSONArray
- 关于本地缓存localstorage与sessionStorage 数组 (array)字符串(string) 对象(object)的存储技巧和注意事项
- android 读取JSON数据(遍历JSONObject和JSONArray)
- java 实现json数组字符串遍历出json对象
- js遍历拼接list集合对象,JSONArray数组
- android 读取json数据(遍历JSONObject和JSONArray
- JSON对象中的JSONObject和JSONArray以及与Map、String、数组的转化
- json对象、json格式字符串、java对象【使用此net.sf.json.JSONObject将java对象[比如数组集合Map、Map扩展]转换成json格式字符串】
- android 读取JSON数据(遍历JSONObject和JSONArray) .
- android 读取json数据(遍历JSONObject和JSONArray)
- JSONObject和JSONArray遍历数组与对象
- android初学------json字符串数组转对象 保存在list集合中 Gson
- jsonArray遍历 取出数组中对象