我有一个演示图片链接:
http://madhabpurps.org/wp-content/uploads/2013/04/28-239x300.jpg
我想在视图持有者类内的布局背景中设置图像:
static class ViewHolder {
TextView txtName;
TextView txtCityState;
RelativeLayout rl;
}
holder.txtName.setText(searchArrayList.get(position).getTitle());
holder.txtCityState.setText(searchArrayList.get(position).getDescription());
我必须从此处的链接设置图像,我已经尝试了这行代码,但它显示错误。
holder.rl.setBackgroundResource(searchArrayList.get(position).getImage());