I have the following XML code in res/drawable and I set button background to this drawable. However when I pressed the button it is not not changing the color. Thanks for help
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@color/pink"/> <!-- pressed state -->
<item android:state_selected="false" android:drawable="@color/blue"/> <!-- default state -->
button :
<Button
android:id="@+id/button12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="1"
android:background="@drawable/button_bg"
android:text="REGISTER"
android:textColor="@color/white"
android:textSize="20sp" />
color XML :
<color name="blue">#49B8C7</color>
<color name="pink">#FF8EB9</color>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…