setImageResource - Strings and Ints when reading from XML-file
<p>I had this, which was working fine:</p>

<pre><code>public static Integer[] photos = new Integer[]    
{R.drawable.photo1,R.drawable.photo2,R.drawable.photo3};

this.setImageResource(photos[mCellNumber]);
</code></pre>

<p>But I decided I wanted to put the filenames in an XML file instead, which I did, like this:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;resources&gt;
&lt;array name="Red"&gt;
    &lt;item&gt;R.drawable.photo1&lt;/item&gt;
    &lt;item&gt;R.drawable.photo2&lt;/item&gt;
    &lt;item&gt;R.drawable.photo3&lt;/item&gt;
&lt;/array&gt;
&lt;/resources&gt;
</code></pre>

<p>And tried stuff like this:</p>

<pre><code>String[] month = getResources().getStringArray(R.array.Red);
this.setImageResource(month[mCellNumber]);
</code></pre>

<p>..and..</p>

<pre><code>String[] month = getResources().getStringArray(R.array.Red);
int bla = Integer.parseInt(month[mCellNumber]);
this.setImageResource(bla);
</code></pre>

<p>I understand why it's not working (strings/ints), but I haven't found any simple way of handling the string to integer conversion part or alternatively, using setImageResource with a string as parameter. Any suggestions?</p>
