title: Android ImageView setImageResource in code
body: <p>I have an imageView that I want to display a little icon of the country that you are currently in. I can get the country code, but problem is I can't dynamically change the imageView resource. My image files are all lowercase (Example: country code=US, image file=us)</p>
  <p>My code (countryCode is the current countryCode in uppercase letters):</p>
  <pre><code>String lowerCountryCode = countryCode.toLowerCase();
  String resource = &quot;R.drawable.&quot; + lowerCountryCode;
  img.setImageResource(resource);
  </code></pre>
  <p>Now, of course this will not work because <code>setImageResource</code> wants an <code>int</code>, so how can I do this?</p>