我有列表視圖,並且在每行必須是圖像的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