Skip to content

Instantly share code, notes, and snippets.

View ItzNotABug's full-sized avatar
:electron:
https://itznotabug.dev

Darshan ItzNotABug

:electron:
https://itznotabug.dev
View GitHub Profile
@emmgfx
emmgfx / gist:0f018b5acfa3fd72b3f6
Created May 2, 2014 07:49
Android JSONArray remove before API 19
// Example of use: remove(i, savedProfiles);
public static JSONArray remove(final int idx, final JSONArray from) {
final List<JSONObject> objs = asList(from);
objs.remove(idx);
final JSONArray ja = new JSONArray();
for (final JSONObject obj : objs) {
ja.put(obj);
}