Skip to content

Instantly share code, notes, and snippets.

@simonewebdesign
Last active December 14, 2015 14:08
Show Gist options
  • Save simonewebdesign/5098826 to your computer and use it in GitHub Desktop.
Save simonewebdesign/5098826 to your computer and use it in GitHub Desktop.
JSONArray a = new JSONArray();
try {
a.put(new JSONObject().put("foo", "bar"));
a.put(new JSONObject().put("bar", "baz"));
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Log.v(TAG, a.toString()); // [{"foo":"bar"},{"bar":"baz"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment