Changing Image In a Button After Being Clicked?

Posted by BuZzZzJaY on Stack Overflow See other posts from Stack Overflow or by BuZzZzJaY
Published on 2010-04-14T04:50:35Z Indexed on 2010/04/14 5:33 UTC
Read the original article Hit count: 271

Filed under:
|
|
|

Creating a game in Android using multiple Buttons to display an image from the drawable folder. I want to change the button to a different image after the button has been clicked on. Here is the button code:

    <Button android:id="@+id/b36"
    android:background="@drawable/black"
    android:layout_width="45px"
    android:layout_height="45px"
    />  

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:

b36.setBackgroundColor(0xAA00AA00);

© Stack Overflow or respective owner

Related posts about android

Related posts about button