java.lang.IllegalStateException:预期BEGIN_ARRAY但在第1行第2列是BEGIN_OBJECT

我正在使用Retro Fit在线连接到API.但我在尝试解析返回的数据时遇到此错误.
retrofit.RetrofitError: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2

返回的数据为This格式,数据模型如下:

iGPlaceApi.getStreams(ITEMS_PER_PAGE,pageNumber * ITEMS_PER_PAGE,new Callback<List<mGooglePlacesApiResponse>>() {

            @Override
            public void success(List<mGooglePlacesApiResponse> mGp,Response response) {
                int n = mGp.size();
                Object asa = mGp.toArray();
            }

            @Override
            public void failure(RetrofitError retrofitError) {
                String error = retrofitError.toString();
            }
        });

public class mGooglePlacesApiResponse {

    public String html_attributions;
    //public List<String> html_attributions;
    public String next_page_token;
    public List<place> results;
}

public class place {

    public Geometry geometry;
    public String icon;
    public String id;
    public String name;
    public openingHours opening_hours;
    public List<Photo> photo
    ...

解决方法

更改列表< mGooglePlacesApiResponse> mGp到mGooglePlacesApiResponse mGp.您的JSON包含对象而不是列表.

@编辑

顺便说一句,html_attributions是一个数组

@ EDIT2

好吧,我看到你纠正了你的html_attrubutions

相关文章

最近看了一下学习资料,感觉进制转换其实还是挺有意思的,尤...
/*HashSet 基本操作 * --set:元素是无序的,存入和取出顺序不...
/*list 基本操作 * * List a=new List(); * 增 * a.add(inde...
/* * 内部类 * */ 1 class OutClass{ 2 //定义外部类的成员变...
集合的操作Iterator、Collection、Set和HashSet关系Iterator...
接口中常量的修饰关键字:public,static,final(常量)函数...