鉴于返回的以下 JSON 字符串:
String s = "{"errorCode":0,"result":"Processed","trips":[{"tripDestination":"Vancouver","tripStartTime":"07:41"},{"tripDestination":"Montreal","tripStartTime":"08:04"}]}";
我可以很容易地得到 errorCode 和结果,例如:
JSONObject jObject;
jObject = new JSONObject(s);
String result = jObject.getString("result");
Log.v("JSON Result", result);
但是我知道它是 JSON 字符串中的一个值数组,我会得到tripDestiation 值吗?