i want to make image button, so when it pressed i will replase the not-pressed image to pressed image of the button, and then go to other activity. i have two different images in drawable.i have two xml files:first one- load the main activity: background and image button\[code\]<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/black" androidrientation="vertical" ><ImageButton android:id="@+id/b1_l" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/s1" android:scaleType="centerCrop" android:background="@color/trans" android:src="http://stackoverflow.com/questions/12446135/@drawable/b1_l" /></RelativeLayout>\[/code\]second one:\[code\]<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="false" android:drawable="@drawable/image_not_pressed" /> <item android:state_pressed="true" android:drawable="@drawable/image_pressed"" /></selector>\[/code\]what is the code that i need to write in addition to my xml?or can i pass the xml and write it only as code...?thanks!