i have listview , and in each row needs to be an hoeizontal scrollview witch N number of images , and its just keeps crashing my app as soon as i start that activity
here is the code
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;
}
I think what you probably want is to have a Gallery in a xml layout file, and that file wil serve as the ListView row and you need to create another Adapter for the Gallery in your current in getView() you need to do this.
I think with this you can have a basic idea what you should do.