0
我有這樣JSON:內容分析錯誤
[
{
"topic": "Example1",
"ref": {
"1": "Example Topic",
"2": "Topic"
},
"contact": [
{
"ref": [
1
],
"corresponding": true,
"name": "XYZ"
},
{
"ref": [
1
],
"name": "ZXY"
},
{
"ref": [
1
],
"name": "ABC"
},
{
"ref": [
1,
2
],
"name":"BCA"
}
] ,
"type": "Presentation"
}
]
我想解析ref
陣列JSON文件。我試過這個。但顯示錯誤。
jsonArray.getJSONObject(index).getJSONArray("ref").getJSONObject(index).toString()
現在的問題是
1)什麼是解析數組內容的正確方法。
什麼是錯誤? – iamnotmaynard
這個JSON有很多'ref';你想要哪一個? –
@JBNizet「ref」:{ 「1」:「示例主題」, 「2」:「主題」 } – user2579475