
试试这个代码
ArrayList<String> list = new ArrayList<String>(); JSonArray jsonArray = (JSONArray)jsonObject; int len = jsonArray.length();if (jsonArray != null) { for (int i=0;i<len;i++){ list.add(jsonArray.get(i).toString()); } }//Remove the element from arraylistlist.remove(position);//Recreate JSON ArrayJSonArray jsArray = new JSonArray(list);编辑: 使用
ArrayList将添加
""到键和值。所以,用
JSONArray自己
JSonArray list = new JSonArray(); JSonArray jsonArray = new JSonArray(jsonstring); int len = jsonArray.length();if (jsonArray != null) { for (int i=0;i<len;i++) { //Excluding the item at position if (i != position) { list.put(jsonArray.get(i)); } } }欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)