我有一個在json中提供圖像路徑的網站。我想要得到這個路徑並在我的ImageView中顯示圖像。從Web獲取圖像的JSON路徑以在ImageView中顯示圖像
提示:targetSdkVersion = 「15」
實施例:
{
"count": "28",
"data": [
{
"id": "84",
"thumb": "http://mmmmm.cccc.com/data/card/thum/a1f694f5ba0df9147c02b0c0c8cb83c2.jpg",
"category": "Purchase",
"title": "test",
"locationname": "test",
"latitude": "0",
"longitude": "0"
}
]
}
以我的活動:
ImageView iv = (ImageView) findViewById(R.id.imageView1);
iv.setImageResource(R.drawable.photo); // this show image that has in project and how about display image that using JSON path above
你能做到嗎?請參閱:http://stackoverflow.com/questions/11504830/jsonexception-when-parse-a-valid-json更多信息 –