Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically change the background LinearLayout

Tags:

android

How to dynamically change the background LinearLayout?

like image 664
user413881 Avatar asked Aug 18 '10 13:08

user413881


1 Answers

Did you try one of these :

yourLayout.setBackgroundColor(int color);
yourLayout.setBackgroundDrawable(Drawable d);
yourLayout.setBackgroundResource(int resid);

and if does not refresh on its own, this should give it a boost :

   yourLayout.invalidate();
like image 123
Sephy Avatar answered Oct 17 '22 02:10

Sephy