0
我想在android中將以下json字符串轉換爲JSONObject
。但它會拋出JSONException
。過去幾個小時我一直在挖掘我的想法。請幫忙。JSON和Android。不能轉換JSON字符串到JSONObject
JSON字符串:
parseExchangeRate({"query":
{"count":1,"created":"2012-09-07T18:49:32Z","lang":"en-US","results":
{"row":{"rate":"55.395","name":"USD to INR"}}}});
例外:
Value <jsonobject>parseExchangeRate(of type java.lang.String cannot be converted to JSONObject
代碼:
String result = convertStreamToString(instream);
Log.d(TAG, result); //this outputs the above stated string
JSONObject json = new JSONObject(result); // this line thows exception
在此先感謝。
鬆散'parseExchangeRate()' – RvdK