通过网络获取图片并缓存
2015-08-18 19:44
603 查看
public class ImageLoaderLoadingListener extends SimpleImageLoadingListener{
ImageView iv=null;
public ImageLoaderLoadingListener(ImageView image)
{
this.iv=image;
}
public void onLoadingComplete(String imageUri,
View view, Bitmap loadedImage){
if(this.iv!=null)
{
super.onLoadingComplete(imageUri, this.iv,
loadedImage);
this.iv.setImageBitmap(BitmapUtil
.transform(loadedImage));
}
}
@Override
public void onLoadingFailed(String imageUri, View view,
FailReason failReason) {
// TODO Auto-generated method stub
super.onLoadingFailed(imageUri, view, failReason);
Toast.makeText(AppManager.getAppManager().currentActivity(),cn.sharing8.blood.R.string.load_photo_fail,Toast.LENGTH_SHORT).show();
}
}
ImageView iv=null;
public ImageLoaderLoadingListener(ImageView image)
{
this.iv=image;
}
public void onLoadingComplete(String imageUri,
View view, Bitmap loadedImage){
if(this.iv!=null)
{
super.onLoadingComplete(imageUri, this.iv,
loadedImage);
this.iv.setImageBitmap(BitmapUtil
.transform(loadedImage));
}
}
@Override
public void onLoadingFailed(String imageUri, View view,
FailReason failReason) {
// TODO Auto-generated method stub
super.onLoadingFailed(imageUri, view, failReason);
Toast.makeText(AppManager.getAppManager().currentActivity(),cn.sharing8.blood.R.string.load_photo_fail,Toast.LENGTH_SHORT).show();
}
}
相关文章推荐
- 网络编程的面试题
- TCP快速重传与快速恢复原理分析
- 书摘---网络搜集整理 (1--10)
- 网络篇----第三方框架AFN02 文件上传
- socket 网络编程快速入门(二)教你编写基于UDP/TCP的服务端多线程通信
- TCP/IP网络编程 学习笔记_11 --多进程服务器端
- TCP/IP网络编程 学习笔记_11 --多进程服务器端
- TCP堵塞控制
- event2/http.h File Reference
- apache https配置步骤
- Choose the best route(http://acm.hdu.edu.cn/showproblem.php?pid=2680)
- 确定比赛名次(http://acm.hdu.edu.cn/showproblem.php?pid=1285)
- HttpClient_me
- HTTP Basic Authentication认证(Web API)
- eclipse启动tomcat 访问http://localhost:8080 报404错误
- openstack 网络简史
- 出现The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path错误
- Volley https support
- 神秘的40毫秒延迟与 TCP_NODELAY
- HTTPS的证书未经权威机构认证的情况下,访问HTTPS站点的两种方法