标签:
String json = "{\"elements\":[{\"distance\":{\"text\":\"1364公里\",\"value\":1364048},\"duration\":{\"text\":\"15.8小时\",\"value\":56973}}]}";
JSONObject obj = JSONObject.fromObject(json.toString());
JSONArray jsonArray = JSONArray.fromObject(obj.getString("elements"));
JSONObject ojb = jsonArray.getJSONObject(0);
JSONObject jms = JSONObject.fromObject(ojb.getString("duration"));
JSONObject jmss = JSONObject.fromObject(ojb.getString("distance"));
System.out.println(jms.getString("text"));
System.out.println(jms.getString("value"));
System.out.println(jmss.getString("text"));
System.out.println(jmss.getString("value"));
标签:
原文地址:http://www.cnblogs.com/lei050/p/5133463.html