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