【发布时间】:2021-04-01 00:14:39
【问题描述】:
我正在尝试实现@GET 请求,但我得到一个空响应。我熟悉使用以下内容实现响应正文
"billers": [
{
"name": "Biller full name",
"slug": "biller-short-name",
"fields": {
"FieldName": {
"type": "can be textfield, date, selectable or hidden",
"required": true,
"placeholder": "This is a field",
"defaultValue": "value1"
"regex": "only appears if the type is textfield e.g. ^[-a-zA-Z .]{1,100}$",
"dateFormat": "only appears if type is date e.g. yyyy-MM-dd",
"values": [
"value1": "only appears if type is selectable",
"value2": "value 2"
]
}
}
]
但这是我第一次实现这样的响应
[
{
"name": "Category full name",
"slug": "category-short-name",
"iconUrl": {
"android": {
"xhdpi": "xhdpi category icon url",
"mdpi": "mdpi category icon url",
"hdpi": "hdpi category icon url"
},
"ios": {
"3x": "3x biller icon url",
"retina": "retina biller icon url",
"nonRetina": "non-retina icon image url"
}
}
}
]
这是我的课程
这是我的错误,调用 api 时收到 200,但是当我尝试在 recyclerview 上显示它时,它说响应为空
【问题讨论】:
-
您是否尝试过记录您在响应中收到的内容?
-
附上代码而不是屏幕截图
标签: java android arrays json arraylist