Here you can find the source of parseJSONArrayToList(JSONArray jsa)
public static ArrayList<Integer> parseJSONArrayToList(JSONArray jsa)
//package com.java2s; import java.util.ArrayList; import org.json.JSONArray; import org.json.JSONException; public class Main { public static ArrayList<Integer> parseJSONArrayToList(JSONArray jsa) { ArrayList<Integer> list = new ArrayList<Integer>(); for (int i = 0; i < jsa.length(); i++) { try { list.add(jsa.getInt(i)); } catch (JSONException e) { e.printStackTrace();/*from w w w . ja va 2s . co m*/ } } return list; } }