[英]java.lang.RuntimeException: Stub! in Android with Mockito
[英]Android - java.lang.RuntimeException: Stub exception while parsing String into JSONObject
我收到了java.lang.RuntimeException: Stub!
我嘗試將String
解析為org.json.JSONObject
。 我的Android API版本是19 。
這是我要解析的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");
這可能是因為你使用android提供的json實現,而你沒有在Android設備或模擬器上運行它。
根據您的實際需要,您可以:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.