Reputation: 31
am getting json response like this
{"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"}
and how to get image value from this response......
Upvotes: 0
Views: 207
Reputation: 1616
The below code snippet gives you the desired value.
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)+"&&&&&&&& " );
Upvotes: 2