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

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

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

asp.net mvc - breakpoint on javascript in CSHTML? -