Я хочу попытаться поместить это в цикл, но я не могу заставить Rid.imageView соответствовать. Я попытался: string id = "R.id.imageView" + i внутри цикла for, но он не соответствует параметрам findViewById. Есть идеи? очень ценю любую помощь.FindViewById Loop
buttons[0] = (ImageView) this.findViewById(R.id.imageView1);
buttons[1] = (ImageView) this.findViewById(R.id.imageView2);
buttons[2] = (ImageView) this.findViewById(R.id.imageView3);
buttons[3] = (ImageView) this.findViewById(R.id.imageView4);
buttons[4] = (ImageView) this.findViewById(R.id.imageView5);
buttons[5] = (ImageView) this.findViewById(R.id.imageView6);
buttons[6] = (ImageView) this.findViewById(R.id.imageView7);
buttons[7] = (ImageView) this.findViewById(R.id.imageView8);
buttons[8] = (ImageView) this.findViewById(R.id.imageView9);
buttons[9] = (ImageView) this.findViewById(R.id.imageView10);
buttons[10] = (ImageView) this.findViewById(R.id.imageView11);
buttons[11] = (ImageView) this.findViewById(R.id.imageView12);