Convert JsonArray to List as it is. Use the Type of the reflect package JSONArray jsonArray; //Some value is entered in jsonArray Gson gson = new Gson(); Type listType = new TypeToken<List<Dto>>() {}.getType(); List<Dto> dtoList = gson.fromJson(jsonArray.toString(), listType); http://stackoverflow.com/questions/8371274/how-to-parse-json-array-in-android-with-gson Recommended Posts Convert Json to List <T> as it is Convert ruby object to JSON format [Java] Convert 1-to-N List to Map Change List <Optional <T >> to Optional <List <T >> in Java Convert JSON to TSV and TSV to JSON with Ruby Is it OutOfMemoryError? Convert Java enum enums and JSON to and from Jackson Sample code to convert List to List <String> in Java Stream I learned stream (I want to convert List to Map <Integer, List>) Program to determine if it is a leap year [Java] Convert JSON to Java and Java to JSON-How to use GSON and Jackson-
JSONArray jsonArray; //Some value is entered in jsonArray Gson gson = new Gson(); Type listType = new TypeToken<List<Dto>>() {}.getType(); List<Dto> dtoList = gson.fromJson(jsonArray.toString(), listType);
http://stackoverflow.com/questions/8371274/how-to-parse-json-array-in-android-with-gson
Recommended Posts