title: Android - how to set background image which path is in array
body: <p>I'm having the following array:</p>
  
  <pre><code>final String[][] dataArr = {
          {"R.drawable.bengaltiger", "bengaltiger"},
          {"R.drawable.cat", "cat"},
          {"R.drawable.chimp", "chimp"},
          {"R.drawable.eagle", "eagle"},
          {"R.drawable.frog", "frog"},
          {"R.drawable.lamb", "lamb"},
          {"R.drawable.wolf", "wolf"},
  };
  </code></pre>
  
  <p>From this one I'm trying to play a sound and use a image as background for the button:</p>
  
  <pre><code>final Button guessRight = (Button) findViewById(R.id.butRight);
  guessRight.setBackgroundResource(R.drawable.bengaltiger);
  </code></pre>
  
  <p>It's not possible to set the background image with an image which uri is in the array because the function "setBackgroundResource" is expecting an int or an URI where I'm having a string.</p>
  
  <p>MY QUESTION WOULD BE HOW TO TRANSFORM THE STRING INTO URI SO i CAN USE THE PATH FROM THE ARRAY WITHIN THE "setBackgroundResource" FUNCTION?</p>
  
  <p>Is my approach correct? or should I use another way to store my data or handle it in different way?</p>
  
  <p>Thank you.</p>