Selector:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/sound_on" android:state_selected="true"></item> <item android:drawable="@drawable/sound_off"></item> </selector>
Added in ImageView
. I want the picture to change when I press it, after I press it again, the picture changes again, and so on.
What do you do in this case? Do you use selectors or is there something better in Android?