I hve searched many times but I did not find what i need.
What i need is :
when a user just click the button I want it changed the background image.(user does not need press to the button I need just one click and change the image )
what i did is :
in selector:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:drawable="@drawable/web_wl" />
<item android:drawable="@drawable/web" />
</selector>
and in button xml :
<Button
android:id="@+id/btn_wb"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/web_selector" />
but this works only a user hold his hand to the button, but I need it works just one click.
thanks in advance