【发布时间】:2016-09-09 14:02:23
【问题描述】:
我的 Json 数据。
{
"data":[
{
"id":"49",
"title":"Dsd",
"date":"2016-09-09 12:15:35",
"descr":"Slader",
"full_story":"Testsdsdfsdffsd",
"images":"2016-09/1472831591.jpg",
"news_read":"4049",
"rating":"150",
"genre":[
"111",
"222",
"333"
]
},
我使用的 Android Studio 插件是“DTO from JSON”,这里是代码
public class GetDataGSON {
@SerializedName("data")
public List<Data> data;
public static class Data {
@SerializedName("id")
public String id;
@SerializedName("title")
public String title;
@SerializedName("date")
public String date;
@SerializedName("descr")
public String descr;
@SerializedName("full_story")
public String full_story;
@SerializedName("images")
public String images;
@SerializedName("news_read")
public String news_read;
@SerializedName("rating")
public String rating;
@SerializedName("genre")
public List<Genre> genre;
}
}
由于某种原因,在这一行中我得到了错误
@SerializedName("genre")
public List<Genre> genre;
无法解析符号“流派”
我做错了什么?
谢谢
【问题讨论】:
-
您需要创建一个
Genre类并对类型数据进行建模 -
我不知道 kak.Vse 自动完成。跨插件 Android 工作室“来自 JSON 的 DTO”:)
-
这不是重复的!!! 1)我正在使用注释。 2)您链接上的人手工制作一切。不同的帖子
标签: android json android-studio gson