Imageloader使用
定义变量
private ImageLoader imgloader=ImageLoader.getInstance();
private static List<String> urllist=Collections.synchronizedList(new LinkedList<String>());
圆角设置
ImageLoader imageloader = ImageLoader.getInstance();
private DisplayImageOptions options = new DisplayImageOptions
.Builder()
.displayer(new RoundedBitmapDisplayer(80))
.build();
static private List<String> urlList = Collections.synchronizedList(new LinkedList<String>());
调用方法
imgloader.displayImage(list.get(arg0).getImg(), holder.item_img,new ImageLoadingListener() {
public void onLoadingStarted(String arg0, View arg1) {
// TODO Auto-generated method stub
}
public void onLoadingFailed(String arg0, View arg1, FailReason arg2) {
// TODO Auto-generated method stub
}
public void onLoadingComplete(String arg0, View arg1, Bitmap arg2) {
// TODO Auto-generated method stub
if (arg2!=null) {
boolean urlboolen=urllist.contains(arg0);
if (!urlboolen) {
urllist.add(arg0);
}
}
}
public void onLoadingCancelled(String arg0, View arg1) {
// TODO Auto-generated method stub
}
});