问题描述
我使用的是Android的查询,下载一个图像中的列表视图中的每个元素,并下载放入系统的图像是非常,非常,非常缓慢(图片远远重)。我很喜欢有一个形象出现,每次5分钟左右..首先我是我们必须实例化一个对象AQuery每个convertView惊喜,我想这LIB不queu线程这种方式。如果有人知道一个更好的lib,我也可以intrested
I'm using android query to download an image in each element of a listview, and downloading thoses images is very, very, very slow (images far from heavy). I'm like having an image appearing each 5 minutes or so..First i'm surprise we've got to instanciate one object AQuery for each convertView, I suppose that lib doesn't queu threads this way.. If someone knows a better lib, I could also be intrested
我不知道我做错了,我希望有人能够帮助!
I don't know what I'm doing wrong and I hope someone could help !
这是我的适配器的code:
here is the code of my adapter :
private class MainPagerListViewAdapter extends BaseAdapter {
private ArrayList<Event> dataList;
private LayoutInflater inflater;
private Context context;
public MainPagerListViewAdapter(Context context,
ArrayList<Event> dataList) {
this.inflater = LayoutInflater.from(context);
this.dataList = dataList;
Collections.sort(dataList, new ALaUneSort());
this.context = context;
}
@Override
public int getCount() {
return dataList.size() + 1;
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
convertView = inflater.inflate(R.layout.main_pager_basic_fragment_item_layout, null);
AQUtility.setDebug(true);
AQuery aq = new AQuery(convertView);
String thumbnail = dataList.get(position-1).file;
aq.id(R.id.imageView).progress(R.id.progress).image(thumbnail, true, true, 0, 0, null, AQuery.FADE_IN);
return convertView;
}
谢谢!
雷诺
推荐答案
请参见下面的延迟加载列表视图的源链接的是,它可以帮助你。
Please see below Lazy Loading listview's source link for that, it may help you.
这篇关于Android的查询,下载图像列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!