How to change the background of an image dynamically according to my spinner selection in Android?
We are designing the page and we need to change background image dynamically.
Is t开发者_如何转开发here any way to load(or change) android application background image dynamically?
help me from come out this problem?
create the id("LinearLayout") for LinearLayout in main.xml and create image in drawble folder and corresponding image drawable id will update in R file.this id we are going to refer for background image change.(according to spinner u are going to assign drawable id )
LinearLayout ln=(LinearLayout) findViewById(R.id.LinearLayout);
ln.setBackgroundResource(R.drawable.image1);
精彩评论