次の 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 値を取得できますか?