title: How to reference an array of EditText created in main.xml
body: <p>My app is getting a little bloated, I would like to 'compress' some code by changing some of my variables into arrays and using some for loops to process my variables.
  My first target is initializing my EditText boxes</p>
  
  <p>My original code (working fine) included:</p>
  
  <pre><code>EditText miBox1, spBox1 ;   
  EditText miBox2, spBox2 ;   
  </code></pre>
  
  <p>...</p>
  
  <pre><code>miBox1 = (EditText)this.findViewById(R.id.miBox1);
  spBox1 = (EditText)this.findViewById(R.id.spBox1);
  miBox2 = (EditText)this.findViewById(R.id.miBox2);
  spBox2 = (EditText)this.findViewById(R.id.spBox2);
  </code></pre>
  
  <p>I actually have twenty mi boxes and 20 sp boxes to setup
  I am trying to create an array, and loop through them</p>
  
  <p>In my main.xml I have renamed my EditText boxes to 
  miBox[1] spBox[1], etc.</p>
  
  <p>I'm declaring in my activity with:</p>
  
  <pre><code>EditText[] miBox = new EditText[20] ;    
  EditText[] spBox = new EditText[20] ;  
  </code></pre>
  
  <p>and putting this into a for loop    </p>
  
  <pre><code>miBox[i] = (EditText)this.findViewById(R.id.miBox[i]);
  spBox[i] = (EditText)this.findViewById(R.id.spBox[i]);
  </code></pre>
  
  <p>but Eclipse cannot resolve R.id.miBox[i]</p>
  
  <p>How do I properly create an array of EditText in my xml so that
  it is recognized?</p>
  
  <p>Thanks
  JD</p>