我的代码遇到了一些问题,我试图找出每个 ImageButton 在我的 ArrayList 中的位置,以查看问题是否存在。如何从 ArrayList 中检索 ImageButton 的名称?
List<ImageButton> images = new ArrayList<ImageButton>();
images.add(imgbut1);
images.add(imgbut2);
images.add(imgbut3);
images.add(imgbut4);
images.add(imgbut5);
在这里,我想得到imgbut1for images.get(0), imgbut2forimages.get(1)等。像images.get(0).getName(),images.get(1).getName()等
谢谢!