I have an xml that declare the button background:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@color/selector_pressed" />
<item android:state_focused="true" android:drawable="@color/selector_focused" />
<item android:drawable="@android:color/transparent" />
</selector>
On my phone Samsung Nexus S (android 4.0.3) , this xml work perfectly, when i press the view the background color change. But I got a problem on tablets (Samsung Galaxy tab, Android 3.2), the button is clicked but i don't see any changes for the backgroung. The background color never change for tablets.
Any one have an idea why this happening only for tablets? and how can i fix this?
selector
is not working or is a refreshing problem.... – Magmares/color
instead ofres/drawable
? You have to changeandroid:drawable
toandroid:color
. – Mamey