If you want to display image and text in each row and if you are using 2 arraylist for the same then here is the solutions. Try this
List<Integer> imageList = getImageList(); //list of drawable ids
List<String> values = getValues();
class CustomAdapter extends BaseAdapter {
@Override
public int getCount() {
// TODO Auto-generated method stub
return imageList.size();;
}
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return null;
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// inflate the layout which contains imageview and textview which are aligned horizontally.
//Assuming you inflated layout and got imageView and textview from that layout
textView.setText(values.get(position));
imageView.setImageResource(imageList.get(position));
return convertView;
}
}
//Code wont work if you directly copy paste. Use the logic and change accordingly
Instead of using 2 arraylist, my suggestion is you use HashMap. Imagepath as key and text as value.