JSONObject获取JSONArray转JSONObject获取某个属性值

String httpPost4Instream = http.httpPost4Instream
JSONObject jsonbject = JSONObject.fromObject(httpPost4Instream);
JSONArray jsonArray = jsonbject.getJSONArray("stores");
String string = jsonArray.getString(0);
JSONObject fromObject = JSONObject.fromObject(string);
String startDate = fromObject.getString("startDate");
String endDate = fromObject.getString("endDate");
param.setFromDate(Long.valueOf(startDate).longValue());
param.setToDate(Long.valueOf(endDate).longValue());

你可能感兴趣的:(java)