【发布时间】:2019-04-20 21:43:49
【问题描述】:
我有如下所示的 JSON
{
"status" : "succesfull",
"items": [
{
"id" : "1",
"name": "apple",
"counrty": "USA"
},
{
"id": "2",
"name": "banana",
"country": "Jamaica"
},
{
"id":"3",
"name": "potatoes",
"counrty": "Belarus"
},
...
]
}
比方说,国家是多种多样的,我不知道哪些国家会在列表中
我需要列出如下清单:
任何解决方案将不胜感激
public class Response {
String status;
ArrayList<Items> items;
}
public class Items{
String id;
String name;
String country;
}
【问题讨论】:
-
您必须编写一些代码来进行结构转换。
-
我不知道如何在列表中创建列表
-
@JustAhead 你试过可扩展的列表视图吗 - androidhive.info/2013/07/android-expandable-list-view-tutorial
标签: java android json android-studio retrofit2