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 t开发者_运维技巧he first activity. How do I read from the SDcard and put them as backgrounds?
Thanks
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()));
精彩评论