Android how to handle button names in array
<p>I have a couple of buttons like</p>

<pre><code>font1 = (Button)findViewById(R.id.fontsize1);
font2 = (Button)findViewById(R.id.fontsize2);
</code></pre>

<p>When I click on a button I want to change its textcolor and also change the textcolor of the rest of the buttons. Of course I do not want to write many lines best practice is a loop.</p>

<pre><code>    font1.setOnClickListener(new View.OnClickListener(){
        public void onClick(View v) {
            SaveFontSize("fontsize", "font1");
            font1.setTextColor(Color.parseColor(color_active));
            font1.setBackgroundResource(R.drawable.fonturesgreen);
            }
        }

        }); 
</code></pre>

<p>I created a list:   </p>

<pre><code>List&lt;String&gt; fontarray = Arrays.asList("font1", "font2", "font3", "font4", "font5");
</code></pre>

<p>And in the loop I tried to do this:</p>

<pre><code>  for (int i=0; i&lt;5; i++) {
    fontarray.get(i).setTextColor(Color.parseColor(color_active));
    }
</code></pre>

<p>This gives me an error, since fontarray.get(i) is a String, not a button.</p>
