0

As I said in the title really, I have several screens in xml files and I use the them as in this application:

Android Homescreen

and I need to update several files in the first activity. How do I read from the SDcard and put them as backgrounds?

Thanks

Community
  • 1
  • 1
MrCloister
  • 452
  • 2
  • 7
  • 19

1 Answers1

1

Right Found the answer! I am using a LinearLayout

   // Get External Storage Directory
    String sdcard = Environment.getExternalStorageDirectory().getAbsolutePath();
    LinearLayout li=(LinearLayout)findViewById(R.id.layoutid);
    li.setBackgroundDrawable(Drawable.createFromPath(newFile(sdcard,"/s1bg.jpg").getAbsolutePath()));
abbas.aniefa
  • 2,855
  • 21
  • 30
MrCloister
  • 452
  • 2
  • 7
  • 19