title: Can I put this into a for loop?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7536791/android-how-to-elegantly-set-many-button-ids">android: how to elegantly set many button IDs</a>  </p>
  </blockquote>
  
  
  
  <p>This is an android program made with eclipse. I've tried using string concatenation in the place of imageButton1 to no avail. R is the generated class so I cannot go into it and edit it so that the imageButtons are part of an array. 
  How can I put this into a for loop?</p>
  
  <pre><code>    seatButton[0] = (ImageButton) findViewById(R.id.imageButton1);
      seatButton[1] = (ImageButton) findViewById(R.id.imageButton2);
      seatButton[2] = (ImageButton) findViewById(R.id.imageButton3);
      seatButton[3] = (ImageButton) findViewById(R.id.imageButton4);
      seatButton[4] = (ImageButton) findViewById(R.id.imageButton5);
      seatButton[5] = (ImageButton) findViewById(R.id.imageButton6);
      seatButton[6] = (ImageButton) findViewById(R.id.imageButton7);
      seatButton[7] = (ImageButton) findViewById(R.id.imageButton8);
      seatButton[8] = (ImageButton) findViewById(R.id.imageButton9);
      seatButton[9] = (ImageButton) findViewById(R.id.imageButton10);
  </code></pre>