public static JSONArray remove(int index,JSONArray jsonArray) {
JSONArray mJsonArray = new JSONArray();
if (index < 0){
return mJsonArray;
}
if (index > jsonArray.length()){
return mJsonArray;
}
for (int i = 0; i < index; i++) {
try {
mJsonArray.put(jsonArray.getJSONObject(i));
} catch (JSONException e) {
e.printStackTrace();
}
}
for (int i = index + 1; i < jsonArray.length(); i++) {
try {
mJsonArray.put(jsonArray.getJSONObject(i));
} catch (JSONException e) {
e.printStackTrace();
}
}
return mJsonArray;
}