I am having some trouble with my code, and I am trying to figure out where each ImageButton is in my ArrayList to see if the problem is there. How do I retreive the name of an ImageButton from an ArrayList?
List<ImageButton> images = new ArrayList<ImageButton>();
images.add(imgbut1);
images.add(imgbut2);
images.add(imgbut3);
images.add(imgbut4);
images.add(imgbut5);
Here, I want to get imgbut1
for images.get(0)
, imgbut2
for images.get(1)
, etc. Something like images.get(0).getName()
, images.get(1).getName()
, etc
Thanks!