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?

  • Are you trying to re-invent the CheckBox?) - xkor
  • @xkor, but what does CheckBox have the src parameter? like Image? - Andro
  • No, but it has the background and button attributes - xkor
  • Yes, and ImageView in principle fit, just change its state to the one you need when you click. - xkor
  • @xkor, is this how hey stet? more can you? - Andro

0