[android-developers] Re: How to set button background color?

2009-10-13 Thread Phil
Hi, What I have done is to retrieve the drawable from the button and then change the color of the drawable with a color filter. Here is an example of code : Drawable dr = ((Button)wid).getBackground(); dr.setColorFilter(color, PorterDuff.Mode.MULTIPLY);

[android-developers] Re: How to set button background color?

2009-10-05 Thread Nicholas Key
On Oct 4, 8:40 pm, Mark Murphy mmur...@commonsware.com wrote: I have a question about setting thebackgroundcolorfor buttons. When I am using btn.setBackgroundColor(Color.RED), the entire button turns into a red rectangle. Correct. Is there actually a workaround to achieve this?

[android-developers] Re: How to set button background color?

2009-10-05 Thread Mark Murphy
On Oct 4, 8:40 pm, Mark Murphy mmur...@commonsware.com wrote: I have a question about setting thebackgroundcolorfor buttons. When I am using btn.setBackgroundColor(Color.RED), the entire button turns into a red rectangle. Correct. Is there actually a workaround to achieve this? What

[android-developers] Re: How to set button background color?

2009-10-05 Thread Nicholas Key
I'd give it a try :) Thanks! On Oct 5, 6:20 am, Mark Murphy mmur...@commonsware.com wrote: On Oct 4, 8:40 pm, Mark Murphy mmur...@commonsware.com wrote: I have a question about setting thebackgroundcolorfor buttons. When I am using btn.setBackgroundColor(Color.RED), the entire button

[android-developers] Re: How to set button background color?

2009-10-04 Thread Mark Murphy
I have a question about setting the background color for buttons. When I am using btn.setBackgroundColor(Color.RED), the entire button turns into a red rectangle. Correct. Is there actually a workaround to achieve this? What is this? Also what can I do to revert back to the default color