【发布时间】:2017-09-16 15:06:14
【问题描述】:
我的要求很简单。我有一个像下面这样的 json 模式。我想帮助进行 JSON 解析。作为类别和子类别的方式。
类别- DIY 子类别 - 配件 子类别- 花园 等等.. 完整的模式会像 DIY 配件 花园 工具 礼物 装饰性的 父亲节 情人节{
"CategoryList": [{
"MainCategory": {
"Attribute_Name": "DIY",
"Attribute_Value": "125",
"StockKeepingunit": null
},
"SubCategory": [{
"Attribute_Name": "126",
"Attribute_Value": "Accessories",
"StockKeepingunit": null
}, {
"Attribute_Name": "127",
"Attribute_Value": "Garden",
"StockKeepingunit": null
}, {
"Attribute_Name": "128",
"Attribute_Value": "Tools",
"StockKeepingunit": null
}]
}, {
"MainCategory": {
"Attribute_Name": "Gifts",
"Attribute_Value": "133",
"StockKeepingunit": null
},
"SubCategory": [{
"Attribute_Name": "134",
"Attribute_Value": "Decorative",
"StockKeepingunit": null
}, {
"Attribute_Name": "135",
"Attribute_Value": "Fathers day",
"StockKeepingunit": null
}, {
"Attribute_Name": "138",
"Attribute_Value": "Valentines Day",
"StockKeepingunit": null
}]
}],
"status": {
"message": "Success",
"result": 1
}}
请任何人帮助我找到正确的编码方式?
【问题讨论】:
-
如果你想学习将 JSON 解析到 android 中,请按照本教程...androidhive.info/2012/01/android-json-parsing-tutorial
标签: android arrays json hashmap expandablelistview