I have a gson.JsonObject
object. What is the easiest way to create a org.json.JSONObject
object from it?
get JSON string again from JsonObject
and parse it in JSONObject
JsonObject gson = new JsonParser().parse("{\"id\":\"value\"}").getAsJsonObject();
JSONObject jo2 = new JSONObject(gson.toString());
new org.json.JSONObject(gson.toJson(gson.JsonObject));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With