i am creating an application in which i want set different background images in main xml linearlayout.I have stored 5 image files on sd card .now i want to select a pic and set it as my maim xml linearlayout background.so it will replace the previous image and display the new image as background.
Share
First assign an id to the main xml linearlayout, for example in the following case it is named” container”
Then in the .java code you can find the layout object and set a drawable as its background:
Regards
Ziteng Chen