• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to change image/drawable with buttonclick

 
Daniel Ungerfält
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im all new to Android Studio and trying to make a simple little halloween app.
I have two backgroundpictures/pictures whatever and I want the second one to appear when pressing the button.
The first pictures and the button is visible. The only thing that happens when pressing the button is that the app is closing.
Here´s my code:









 
Daniel Ungerfält
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For some reason it just started to working! :-)
But now I got a new problem. I added a second button just to be able to exit the app. When adding the button and the code the app just brakes in the right beggining,
-with a message like: "your app has stopped" and a ok-button.







 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic