在java中解析JSON

4 java android json

我正在尝试解析android中的JSON但是在访问对象的子子时遇到了麻烦.我试图从以下提取增量,

{"augment-list": {
  "time": "12:01",
  "channel": "channel1",
    "augment": [
      {"id": "123", "name": "here", "x": "5", "y": "10", "orientation": "up", "content": "some stuff"},
      {"id": "456", "name": "there", "x": "12", "y": "25", "orientation": "down", "content": "more stuff"},
      {"id": "789", "name": "over there", "x": "1", "y": "2", "orientation": "left", "content": "and more"}
    ]
}}
Run Code Online (Sandbox Code Playgroud)

我已经尝试通过获取名为augment的扩充列表的JSON对象或扩充[0]来访问扩充,但无法弄清楚如何访问内部的每个扩充.

Tim*_*ter 7

如果没有更多关于出错的细节,我不知道问题可能是什么.你收到错误了吗?你能发一些代码吗?

你有这样的东西吗?

json.getJSONObject("augment-list").getJSONArray("augment").getJSONObject(0).getInt("id")
Run Code Online (Sandbox Code Playgroud)