我是新的Android程序员,我的代码遇到了一个问题“无法从START_OBJECT令牌中反序列化java.util.ArrayList
的实例”。
我正在使用Retrofit + Java来调用“电影数据库” API。
我的杰森:
{
"results": [
{
"vote_count": 106,
"id": 335983,
"video": false,
"vote_average": 6.2,
"title": "Venom",
"popularity": 324.891,
"poster_path": "/2uNW4WbgBXL25BAbXGLnLqX71Sw.jpg",
"original_language": "en",
"original_title": "Venom",
"genre_ids": [
27,
878,
28,
53
],
"backdrop_path": "/VuukZLgaCrho2Ar8Scl9HtV3yD.jpg",
"adult": false,
"overview": "When Eddie Brock acquires the powers of a symbiote, he will have to release his alter-ego “Venom” to save his life.",
"release_date": "2018-10-03"
},
{
"vote_count": 2321,
"id": 363088,
"video": false,
"vote_average": 6.9,
"title": "Ant-Man and the Wasp",
"popularity": 195.01,
"poster_path": "/rv1AWImgx386ULjcf62VYaW8zSt.jpg",
"original_language": "en",
"original_title": "Ant-Man and the Wasp",
"genre_ids": [
28,
12,
35,
878,
10751,
10749
],
"backdrop_path": "/6P3c80EOm7BodndGBUAJHHsHKrp.jpg",
"adult": false,
"overview": "Just when his time under house arrest is about to end, Scott Lang puts again his freedom at risk to help Hope van Dyne and Dr. Hank Pym dive into the quantum realm and try to accomplish, against time and any chance of success, a very dangerous rescue mission.",
"release_date": "2018-07-04"
}...
我使用Retrofit将其称为Json: 我使用Retrofit将此称为Json: 我使用Retrofit将此称为Json: 我使用Retrofit将其称为Json:
Call<List<Filmes>> listaPopulares = new RetrofitInicializador().getFilmesService().listaPopulares();
listaPopulares.enqueue(new Callback<List<Filmes>>() {
@Override
public void onResponse(Call<List<Filmes>> call, Response<List<Filmes>> response) {
Log.e("ItsOk", "ok");
List<Filmes> lista = response.body();
listaPopulares(lista);
}
@Override
public void onFailure(Call<List<Filmes>> call, Throwable t) {
Log.e("Error", t.getMessage());
}
});
,我的模型是基本模型。
有人可以帮助我吗?