[英]Android - download attached image from URL
有一個沒有圖像擴展名的URL,無論該URL在瀏覽器中轉到哪里,它都將下載圖像。
在提琴手中,我可以看到這樣的響應
HTTP/1.1 200 OK
Server: nginx
Date: Sun, 21 Dec 2014 08:08:53 GMT
Content-Type: image/jpg
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Disposition: attachment; filename="current.jpg"
我希望能夠獲取該“ current.jpg”圖像並將其添加到imageview。 我嘗試過
BitmapFactory.decodeStream(url.openConnection().getInputStream());
但這會使我的imageview空白。
您可以使用AQuery庫從網絡加載圖像。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.