用java解析JSON
我试图在android中解析JSON,但在访问对象的子对象时遇到了问题。我试图从以下内容中提取augment用java解析JSON,java,android,json,Java,Android,Json,我试图在android中解析JSON,但在访问对象的子对象时遇到了问题。我试图从以下内容中提取augment {"augment-list": { "time": "12:01", "channel": "channel1", "augment": [ {"id": "123", "name": "here", "x": "5", "y": "10", "orientation": "up", "content": "some stuff"}, {"id"
{"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"}
]
}}
我尝试通过获取名为augment或augment[0]的augment list的JSON对象来访问augment,但无法理解如何访问其中的每个augment 如果没有更多的细节,我不知道问题出在哪里。你有错误吗?你能发一些代码吗 有这样的吗
json.getJSONObject("augment-list").getJSONArray("augment").getJSONObject(0).getInt("id")