Android读取url图片保存及文件读取

参考:

1、http://blog.csdn.net/ameyume/article/details/6528205

2、http://blog.sina.com.cn/s/blog_85b3a16101011hnp.html

总结:

1、保存图片两种方式均可:一种是先转换为byte[],再生成bitmap;一种是直接用InputStream生成bitmap

2、4.0中不允许在主线程,即UI线程中操作网络,所以必须新开一个线程,在子线程中执行网络连接;然后在主线程中显示图片。

3、读取图片:Bitmap bitmap = BitmapFactory.decodeFile("/sdcard/icon.png");

原文地址:https://www.cnblogs.com/sudawei/p/3388158.html