JSONObject obj = new JSONObject(); JSONArray jsonArray = new JSONArray(); if(null != typeBean){ try { obj.put("changeType", typeBean.changeType); obj.put("customerType", ""); for(int i = 0;i<typeBean.customerIds.size();i++) { jsonArray.put( typeBean.customerIds.get(i)); } obj.put("customerIds",jsonArray); Log.e("ERE",obj.toString()); Log.e("ERE",obj.toString()); } catch (JSONException e) { e.printStackTrace(); } }
Android转JsonObject中包含JsonArray
最新推荐文章于 2022-11-22 10:32:36 发布