android how to get view's ID from name
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3042961/how-can-i-get-the-resource-id-of-an-image-if-i-know-its-name">How can i get the resource id of an image if I know its name?</a>  </p>
</blockquote>



<p>hi i want to get the id of an image,i could do this,</p>

<pre><code>int id = R.layout.imagename
</code></pre>

<p>then i could do this</p>

<pre><code>imageView.setImageResource(id)
</code></pre>

<p>but my question is how to get the id if i know the imagename changes at run time, so on this case how can i make <code>R.layout."imagename"</code> ? </p>
