I am trying to deserialize (parse) this JSON: {"test": "TEST2"}
I am new to Java, so I've searched a lot on Google and I finally found the answer here: https://stackoverflow.com/a/18998203/8524395
So, I am trying to deserialize my JSON like that:
JSONObject obj = new JSONObject("{\"test\": \"TEST2\"}");
String testValue = obj.getJSONObject("test").toString();
But I am getting the error: JSONObject obj = new JSONObject("{\"test\": \"TEST2\"}");
String pageName = obj.getJSONObject("test").toString();
Any help would be appreciated.
Thanks!