I have an image button on my view that I need to change after interacting with the user. I find nothing like myImageButton.setDrawable Here is my xml for the button I want to change:
<ImageButton android:id="@+id/stopButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/buttons_background" android:layout_centerHorizontal="true" android:layout_marginTop="5dp" android:background="@null" android:src="@drawable/btn_play" />
The only line I need to programmatically change android:src="@drawable/btn_play" is android:src="@drawable/btn_stop" . It can be done? Thanks in advance.
java android android-layout android-button
madcoderz
source share