How to access a string using a dynamic string name in android (similar to eval in javascript)?
<p>I'm trying to access string variables using dynamic names depending on what position my gallery is at. To get the value of a string using a fixed name I use the following which is fine (the string is called pic1info):</p>

<pre><code>String strTest = getResources().getString(R.string.pic1info);  
</code></pre>

<p>My strings are named pic1info, pic2info, pic3info etc and I want to replace the static definition of pic1info to include the position so pass the contents of the following string in place of pic1info above so that it returns a different string depending on the current position:</p>

<pre><code>String strDynamicStringName= "pic" + position + "info";
</code></pre>

<p>In javascript the equivalent would be eval, i'm sure there's a simple way to do this but i can't work out how!</p>

<p>Thanks so much for your help as ever!</p>

<p>Dave</p>
