refer to an image with an array content
<p>how is it possible to refer to an image with an array index at the end of the image name? Here is the code i would like to work (doesnt though...:()</p>

<pre><code>for (int i = 0; i &lt; melodiToner.length; i++)

setImageResource(R.drawable.gronpil+melodiToner[i]);
</code></pre>

<p>i.e I would like to load image <code>gronpil1.png</code> in the first loop, <code>gronpil2.png</code> in the second.
This isnt relative to the array content, I need some other file name endings so i cannot use the i variable, it has to be from the array.</p>

<p>Thanks for all help!</p>

<p>Andreas</p>
