我有一个ListView
显示Drawable
s
这是我的代码:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
convertView = inflater.inflate(
R.layout.main_advertisement_list_view_item, null);
holder.icon = (ImageView) convertView
.findViewById(R.id.imageView1);
holder.name = (TextView) convertView
.findViewById(R.id.textView1);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
Log.d("view", holder.name+"");
Log.d("string",getItem(position)+"");
holder.name.setText(getItem(position).name);
holder.icon.setImageResource(
categories_icons.getResourceId(position, -1));
return convertView;
}
我如何延迟加载Drawables
?我看到了示例和示例,但是对于本地可绘制对象,由于我的代码使列表视图移动缓慢,我该如何实现呢?