jsonobject 转 jsonarray,jsonarray遍历

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xiaoqiangyonghu/article/details/81062259

 jsonobject 转 jsonarray

 JSONObject      jsonObject1 =(JSONObject) JSONObject.parse(result.body().toString());

    JSONArray datalist = jsonObject1.getJSONObject("data").getJSONArray("items");

 jsonarray遍历

    Iterator<Object> it = jsonarray.iterator();
while (it.hasNext()){
JSONObject news = (JSONObject) it.next();
ids.add(news.getString("id"));
}

猜你喜欢

转载自blog.csdn.net/xiaoqiangyonghu/article/details/81062259