I want to transfer a list object via Google Gson, but I don\'t know how to deserialize generic types.
What I tried after looking at this (BalusC\'s answer):
Wep, another way to achieve the same result. We use it for its readability.
Instead of doing this hard-to-read sentence:
Type listType = new TypeToken>(){}.getType();
List list = new Gson().fromJson(jsonArray, listType);
Create a empty class that extends a List of your object:
public class YourClassList extends ArrayList {}
And use it when parsing the JSON:
List list = new Gson().fromJson(jsonArray, YourClassList.class);