I'm getting java.lang.RuntimeException: Stub!
exception when I try to parse String
to org.json.JSONObject
. My Android API version is 19 .
Here is my String
to be parsed:
{
"url": "http://www.google.com",
"cookie": "012121",
"filename": "Google"
}
JSONObject jsonObject = new JSONObject(str); // getting exception at this line
String url = jsonObject.getString("url");
It is probably because you are using android-provided json implementation and you are not running it on an android device or emulator.
Depending on your real need you can either :
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.