0

このようなjson応答を取得しています

{"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"]、"タグ": "ff"}

そして、このレスポンスから画像の値を取得する方法......

4

1 に答える 1

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)+"&&&&&&&&     " );
于 2012-04-27T15:49:36.283 に答える