我只想从 URL 下载一张图像,然后将其保存(到我的文件夹)。该图像是用户的头像。我找到了以下链接:
Best method to download image from url in Android
Android Download Image From URL and show in Imageview
我该怎么办?
最好的解决方案是什么? (下载管理器除外)
最佳答案
最好的方法是使用picasso library
Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);
非常简单,只需将这一行放在您要加载图像的位置即可。 Picasso 还支持图像缓存,因此您不必担心下载和缓存图像。
关于android - 下载图像并将其保存在 android 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26504042/