oldu API çevrimiçi bağlanmak için Retro Fit
kullanıyorum. Ancak, döndürülen verileri ayrıştırmaya çalışırken bu hatayı alıyorum. Veri iade edilenjava.lang.IllegalStateException: Beklenen BEGIN_ARRAY ancak BEGIN_OBJECT satır 1 sütun 2
retrofit.RetrofitError: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2
This formatında ve veri modeli aynı zamanda aşağıda verilmiştir: mGooglePlacesApiResponse mGp
için
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
...
sizin json jsonarray ile başlar sizin html_attrubutions düzeltilmiş bkz edit2
Well @ dizisi
mı? – Raghunandan