title: Android: Set a random image using setImageResource
body: <p>I need a help with setting a random image using setImageResource method.
  In the drawable folder, I have a jpeg file named photo0.jpg, photo1.jpg...photo99.jpg.
  And the following code works:</p>
  
  <pre><code>int p = R.drawable.photo1;
  image.setImageResource(p);
  </code></pre>
  
  <p>The above will display photo1.jpg but I want to show a random image.
  I tried the following but it doesn't work.</p>
  
  <pre><code>String a = "R.drawable.photo";
  int n = (int) (Math.random()*100)
  String b = Integer.toString(n);
  String c = a+b;
  int p = Integer.parseInt(c);//checkpoint
  image.setImageResource(p);
  </code></pre>
  
  <p>It seems like the string "R.drawable.photoXX" isn't being changed to integer at the checkpoint.
  Could someone please teach me a right code?
  Thank you in advance.</p>