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