Array and for loop will not work with current setup where EditTexts are being defined
<p>I am trying to shorten my code by using a for loop and an array to define my declared edit texts but it won't work.</p>

<pre><code>    final String[] names = new String[]{"ivTextView", "degreeTextView", "initialYTextView", "initialXTextView", "timeTextView", "distanceTextView", "peakTextView"};
int[] ids = new int[]{R.id.ivTextView, R.id.degreeTextView, R.id.initialYTextView, R.id.initialXTextView, R.id.timeTextView, R.id.distanceTextView, R.id.peakTextView};

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.results);
    //Reference the TextViews
    for(int i =0; i &lt; names.length; i++ ){
        names[i] = (TextView) findViewById(ids[i]);
    }
</code></pre>
