【发布时间】:2021-12-19 02:07:25
【问题描述】:
我有一个这样的 json:
{"status": "ok","data": {
"0": {
"id": "1901",
"price": "0",
"userBought": "0",
"leagueName": "Germany League",
"teamOne": "Grossaspach",
"teamTwo": "Offenbacher",
"date": "05.11.2021 - 21.00",
"result": "0",
"teamOneScore": "0",
"teamTwoScore": "0",
"info": "+1.5 Goal Over",
"ratio": "1.19"
},
"1": {
"id": "1900",
"price": "0",
"userBought": "0",
"leagueName": "France League",
"teamOne": "FC Villefranche-Beaujolai",
"teamTwo": "US Avranches",
"date": "05.11.2021 - 21.00",
"result": "0",
"teamOneScore": "0",
"teamTwoScore": "0",
"info": "+1.5 Goal Over",
"ratio": "1.25"
},
"2": {
"id": "1899",
"price": "0",
"userBought": "0",
"leagueName": "Germany League",
"teamOne": "Holstein Kiel",
"teamTwo": "Dynamo Dresden",
"date": "05.11.2021 - 20.30",
"result": "0",
"teamOneScore": "0",
"teamTwoScore": "0",
"info": "+1.5 Goal Over",
"ratio": "1.20"
}}}
但我无法使用 volley 从“数据”标签中获取字符串对象,因为没有任何 json 数组可用于 foreach 标签。
我累了,我搜索了很多例子。我无法从 stacoverflow 找到任何解决方案。 谁能帮帮我?
【问题讨论】:
-
请提供足够的代码,以便其他人更好地理解或重现问题。
标签: java android json jsonparser