我有列表视图,并且在每行必须是图像的hoeizontal滚动视图女巫N多,而其只是不断尽快崩溃我的应用程序,因为我开始这一活动Android的列表视图不会加载图像
这里是代码
public View getView(int position, View convertView, ViewGroup parent) {
View vi=convertView;
if(convertView==null){
vi = inflater.inflate(R.layout.foto_list_row, null);
}
TextView title = (TextView)vi.findViewById(R.id.foto_title); // title
HashMap<String, String> n = new HashMap<String, String>();
n = data.get(position);
LinearLayout ll = (LinearLayout) vi.findViewById(R.id.fotoh);
String var[] = (n.get(FotoView.TAG_ALBUM)).split(",");
ImageView iv = new ImageView(activity.getApplicationContext());
for(int a=0;a<var.length;a++){
String t = var[a];
if(t == "null"){
t.replace("null", "");
}else{
//tv.setText(t);
imageLoader.DisplayImage(t,iv);
ll.addView(iv);
}
}
// Setting all values in listview
title.setText(n.get(FotoView.TAG_TITLE));
return vi;
}
请添加logcat。 – rahul
问题与您的适配器... – Shiva