2012-04-27 70 views
0

我越来越喜欢这个如何从JSON响应

{ “内容” JSON响应得到jsonarry值: “”, “面包屑”: “”, “副标题”: “”, “作家”:“ “, ”title“:”fas“,”absolute_url“: ”http://abrilemlondres.com.br/599/voce-em-londres/fas“, ”commentsEnabled“:false,”releaseDateTime“:1335524514 , “形象”: [ “http://abrilemlondres.com.br/m/up/40/00/553.jpg”], “标签”: “FF”}

以及如何获得这个回应的图像价值......

回答

2

下面的代码片段为您提供了所需的值。

String jsonExample = "{\"content\": \"\", \"breadcrumb\": \"\", \"subtitle\": \"\",    \"author\": \"\", \"title\": \"fas\", \"absolute_url\": \"http://abrilemlondres.com.br/599/voce-em-londres/fas\", \"commentsEnabled\": false, \"releaseDateTime\": 1335524514, \"image\": [\"http://abrilemlondres.com.br/m/up/40/00/553.jpg\"], \"tags\": \"ff\"}"; 

JSONObject jsonobject = new JSONObject(jsonExample); 

JSONArray array = jsonobject.getJSONArray("image"); 

System.out.println("$$$$$$$$$  "+array.getString(0)+"&&&&&&&&  "); 
+1

感谢您的帮助sharma ......现在我得到了解决方案.... – Muraliganesan 2012-04-27 16:31:21