I have an object gson.JsonObject. What is the easiest way to create an object from it org.json.JSONObject?
gson.JsonObject
org.json.JSONObject
Thanks in advance.
get the JSON string again JsonObjectand parse it intoJsonObject
JsonObject
JsonObject gson = new JsonParser().parse("{\"id\":\"value\"}").getAsJsonObject(); JSONObject jo2 = new JSONObject(gson.toString());
new org.json.JSONObject(gson.toJson(gson.JsonObject));