Problem: parse the following response from Foursquare Venues API:
{
meta: {
code: 200
}
notifications: [
{
type: \"notificationTr
This is correct because the object you are trying to access is not an array, you should do something like this:
JsonParser parser = new JsonParser();
JsonObject data = parser.parse(response).getAsJsonObject();
Meta meta = gson.fromJson(data.get("meta"), Meta.class);
Response myResponse = gson.fromJson(data.get("response"), Response.class);
Or you can create an object containing 3 classes for the 3 objects and then parse everything through GSON.