I use “selector” to replace imagebutton’s background.Now the background can be replace only when I press the imagebutton.If I don’t press it, the background will become original picture.I want to have this result: The original background is No.1 picture.After I press it,it will be replaced by No.2 picture even if I don’t press it.

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false" android:drawable="@drawable/nav_product"></item>
<item android:state_pressed="true" android:drawable="@drawable/nav_product_a"></item>
In the selector,it has many parameters.I don’t know I should use which one.Or must I code in Activity?
You can try following .xml file for your problem