thanks for reading. I'm making an app that can write musical scales based on input from spinners in the layout. I have 11 of Imageviews that take a LOT of information from a LOT of spinners, then those imageviews change on the click of a button in the layout. In short, I want to store the ImageViews in an ArrayList. This is my idea:
//Initilization of ArrayList as a member:
ArrayList<ImageView> pics;
//in onCreate():
pics = new ArrayList<ImageView>();
pics.add((ImageView) findViewById(R.id.picA);
pics.add((ImageView) findViewById(R.id.picB); //etc through picK
//in onClick():
for (int i; i++; i<11){
if ("test".equals(noteArray[i]) pics[i].setImageResource(R.drawable.testPic);
if ("testTwo".equals(noteArray[i]) pics[i].setImageResource(R.drawable.secondTestPic);
etc
But I am unable to use setImageResource() on pics[x]. It works fine on a regular ImageView object, am I using the ArrayList wrong?