相关疑难解决方法(0)

无法使用Gson解析Json数组

我有这个json数组:

 [
{
"id":18,
"city":"??????",
"street":"??????? 1",
"zipcode":121209,
"state":"IL",
"lat":32.158138,
"lng":34.807838
},
{
"id":19,
"city":"??????",
"street":"??? ??? 1",
"zipcode":76812,
"state":"IL",
"lat":32.161041,
"lng":34.810410
}
]
Run Code Online (Sandbox Code Playgroud)

我有这个类来保存数据:

public class MapData {
    private int id;
    private String city;
    private String street;
    private String state;
    private int zipcode;
    private double lat;
    private double lng;

    public MapData(int id, String city, String street, String state,
            int zipcode, double lat, double lng) {          
        this.id = id;
        this.city = city;
        this.street = street;
        this.state = state;
        this.zipcode = …
Run Code Online (Sandbox Code Playgroud)

java android json gson

8
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1

gson ×1

java ×1

json ×1