I have few arguments. first one is in
public JSONObject(String json) throws JSONException {
this(new JSONTokener(json));
with:
this(new JSONTokener(json));
second one is
public JSONObject(JSONTokener readFrom) throws JSONException
Object object = readFrom.nextValue();
if (object instanceof JSONObject) {
this.nameValuePairs = ((JSONObject) object).nameValuePairs;
} else {
throw JSON.typeMismatch(object, "JSONObject");
}
}
with:
throw JSON.typeMismatch(object, "JSONObject");
It gives the JSONObject constructor a String. I don't know if it's acceptable but I know it worked for me in the past. maybe there is a way to convert string to JSONString or something like that?