2

Possible Duplicate:
Standard Android Button with a different color

i would like to make a red button in my android application.

i need it to be red from the start and i also need it to stay red after events.

is there a way of doing this?

0

1 Answer 1

11

Did you try at all to get some info about this? ;)

http://developer.android.com/reference/android/widget/Button.html Read that to know how to declare buttons

I use this personally (implying a Button has already been declared as button, as above):

button.getBackground().setColorFilter(0xFFFF0000,PorterDuff.Mode.MULTIPLY);

This ensures that it looks like a Button after you apply the new color too. I had issues with setBackgroundColor(int color) on that note.

You can also use Color.RED instead of the Hex value that I put.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.