ColorStateList and Buttons?

Put your problem here if it does not fit any of the other categories.

ColorStateList and Buttons?

Postby aetmos » Tue Feb 19, 2008 11:22 am

How can I apply a ColorStateList to the background color of a button?

I'd love to change the highlight color away from orange. The View documentation seems to suggest that I should be able to use android:backround="@color/default_state" (for instance), where default_state is the same as is shown in the ColorStateList documentation. However, when I try this, I get an "Application Error":

"Unable to start activity ComponentInfo{[activity name removed]}: android.view.ViewInflate$Inflate Exception: Binary XML file line #26: Error inflating class java.lang.reflect.Constructor"

I can successfully apply a ColorStateList to the text of a button using android:textColor="@color/default_state", but that's not what I want to do. I want to get rid of this ugly orange highlighting.

Junior Developer
Junior Developer
Posts: 21
Joined: Fri Jan 18, 2008 12:33 am


Postby kodex83 » Thu Dec 04, 2008 10:16 am

I have the same problem.
Have you a solve?
Posts: 9
Joined: Wed Dec 03, 2008 6:00 pm
Location: Germay


Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 7 guests