user3356636
user3356636

Reputation: 113

Binding buttons together android in eclipse

Hi im creating a app(school project) that's going to have five buttons with one color each. Red, yellow, blue, white, black.

This is a game for children, first they will see a image that's just white, they will get instructions to paint it by combining colors

When I for example want green I click yellow and blue and the image is going to change to green.

My problem is that I want to handle the clicks.. If I click first the yellow button it´s going to save some how and then when I click blue the image will change. But if they click the wrong combination a sound will play.. and then resten the buttons..

I don't want a whole solution just a point in the right direction.. so i can start coding this

Upvotes: 0

Views: 44

Answers (1)

Simon
Simon

Reputation: 6363

For simple applications you can just use a Singleton to store the state with the buttons that have been pressed.

In your touch event listener you call some method in your Singleton object to keep track of the previous presses.

Upvotes: 1

Related Questions