title: creating a drawable from sd card to set as a background in android
body: <p>I am trying to use an image from the sd card and set it as the background for a relativelayout.  I have tried other solutions that i have found here and elsewhere but they havent seemed to work for me.  here is my code.  I have commented out other ways that i have tried and didnt work.  the only thing that worked for me was using setBackgroudnResource and using a resource from the app, but this was just to test to make sure mRoot was set up correctly.  when I have tried all the other ways, it just doesn't set anything.  Anyone know what I am doing wrong, or if there is a better way to do this?</p>
  
  <pre><code>        //one way i tired...
  //String extDir = Environment.getExternalStorageDirectory().toString();
  //Drawable d = Drawable.createFromPath(extDir + "/pic.png");
  //mRoot.setBackgroundDrawable(d);
  
  //another way tried..
  //Drawable d = Drawable.createFromPath("/sdcard/pic.png");
  //mRoot.setBackgroundDrawable(d);
  
  //last way i tried...
  mRoot.setBackgroundDrawable(Drawable.createFromPath(new File(Environment.getExternalStorageDirectory(), "pic.png").getAbsolutePath()));
  
  //worked, only to verify mRoot was setup correctly and it could be changed
  //mRoot.setBackgroundResource(R.drawable.bkg);
  </code></pre>