Not sure how to describe this one so I'll just do my best. I have a ListView that always displays five strings whatever is selected. I've copied an example to place images at the left of each list item. However I have five separate images and I don't know how to set each respective image in the custom array adapter. The current code is as follows:
String s = values[position]; if (s.startsWith("Windows")) { imageView.setImageResource(R.drawable.image1); } else { imageView.setImageResource(R.drawable.image2); }
I want mine to do the following:
if index = 0 then setImageResource as image1; elseif index = 1 then setImageResource as image2, etc.
Can I do this?