[英]Android - java.lang.RuntimeException: Stub exception while parsing String into JSONObject
I'm getting java.lang.RuntimeException: Stub!
我收到了java.lang.RuntimeException: Stub!
exception when I try to parse String
to org.json.JSONObject
. 我尝试将String
解析为org.json.JSONObject
。 My Android API version is 19 . 我的Android API版本是19 。
Here is my String
to be parsed: 这是我要解析的String
:
{
"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. 这可能是因为你使用android提供的json实现,而你没有在Android设备或模拟器上运行它。
Depending on your real need you can either : 根据您的实际需要,您可以:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.