使用Retrofit Json填充微调器

时间:2016-02-24 05:08:32

标签: android json list spinner retrofit

我必须从API Json响应中填充时区列表。我是android的新手,搜索了许多代码,但没有一个对我有用。我有这个回应并使用Rerofit 1.9来访问它。我不想为此创建额外的POJO类,只想获取列表并将其添加到列表中以在微调器中显示。其他示例具有其他类,并为结果映射数组。有一个简单的方法来做到这一点。我的回复代码看起来像。

{"status": {
"response_code": 0
"response_message": "OK"
"response_extra": nul
}-
"data": {
"Timezone": [416]
0:  {
"code": "Africa/Abidjan"
"title": "Africa/Abidjan"
}-
1:  {
"code": "Africa/Accra"
"title": "Africa/Accra"
}-
2:  {
"code": "Africa/Addis_Ababa"
"title": "Africa/Addis_Ababa"
}-
3:  {
"code": "Africa/Algiers"
"title": "Africa/Algiers"
}
-...
-....
-....
-...
-...
}
}

0 个答案:

没有答案
相关问题