android - How to get Background color for a Button -


i have imagebutton , background color

 android:src="@color/c105" 

how can color programmatically ?

i want color not drawable

getresources().getcolor(r.color.c105); 

should it

you set color on image button having reference in code this:

(imageview) findviewbyid(r.id.your_image_view).setbackgroundcolor(getresources().getcolor(r.color.c105); 

Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -