Changing Image In an ImageButton After Being Clicked?
- by BuZzZzJaY
Creating a game in Android using multiple ImageButtons to display an image from the drawable folder and I want to change the button to a different image after the button has been clicked on. Here is the code for my image button:
<ImageButton
android:id="@+id/b56"
android:layout_width="45px"
android:layout_height="45px"
android:layout_gravity="center_vertical"
android:src="@drawable/black"
/>
I can't find anything about how to change the actual image of the button. You can change the color of the button by using the following code in the java file:
b32.setBackgroundColor(0xAA00AA00);