public static void addJsonList(String json, String user) throws Exception { JSONObject jsonObj = new JSONObject(json); JSONArray list = jsonObj.getJSONObject("data").getJSONArray("users"); for (int i = 0; i < list.length(); i++) { JSONObject obj = list.getJSONObject(i); addjson(obj.toString(), user); } }