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 is "this"?



"this" refers to the intention to set the button with a Red background
color.
I actually meant to ask if there are any other ways to set the button
with a Red background color.

:)


>
> > Also what can I do to revert back to the defaultcolorof the button
> > (the typical plain greyshbackground).
>
> Rummage through the Android source code, figure out what the name is of
> the standard ButtonbackgroundDrawable, and set thebackgroundback to
> that Drawable. Or, call getDrawable() before changing thebackgroundin
> the first place, hold onto that value, and use it to reset the 
> Button'sbackgroundlater.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> Android App Developer Books:http://commonsware.com/books.html


Thanks for your reply, Mark.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to