Android Custom Button Pressed State

android, custom-controls

Solution

Switch the order of the items (so pressed first, then neutral). Pressed or not, the top item is always true.

Problem

I am trying to change the appearance of an Android Button, but I can't get it to work. I use this code in "custom_button.xml" to handle the drawing of the button: ``` <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/btn_normal" /> <item android:drawable="@drawable/btn_over" android:state_pressed="true"/> ``` In my layout file I set the button's background to the custom_button drawable. The normal state works (the one that first appears), but when the button is pressed the image doesn't change. I double checked to make sure I am using different images and I am. Does anyone know why this isn't working? Thanks!

Original source