我有列表视图,并且在每一行中都需要一个横向滚动视图,包含 N 个图像,并且只要我开始该活动,它就会不断使我的应用程序崩溃
这是代码
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;
}