Skip to content

Instantly share code, notes, and snippets.

View SivanLiu's full-sized avatar

Sivan SivanLiu

  • Hangzhou, Zhejiang
View GitHub Profile
@SivanLiu
SivanLiu / JsonHelper.java
Created August 19, 2016 00:00 — forked from codebutler/JsonHelper.java
Convert Android JSONObject/JSONArray to a standard Map/List.
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
public class JsonHelper {
public static Object toJSON(Object object) throws JSONException {
if (object instanceof Map) {
JSONObject json = new JSONObject();