Question: Using Java, in ANDROID STUDIO, I need the code for the following requirements: There will be one imageView, one button, and two textviews. - The

Using Java, in ANDROID STUDIO, I need the code for the following requirements:

There will be one imageView, one button, and two textviews.

- The number of times the user clicks on the imageView represents the number of coins the user has. (this number should be displayed in the first textview)

- The button should initially be disabled (so the setClickable is set to false). The button's text displays the number of coins needed to buy candy.

- The initial amount of coins needed to buy candy is 10. If the number of coins in the first textview (the one which increases as the user clicks on imageView) is equal to or greater than 10, the button is enabled (so the setClickable is set to true).

- When the button is enable, if the user then clicks the button, the initial amount of coins needed to buy candy (10) should be subtracted from the number of coins the user has. This is the new amount of coins that the user has now (this should be shown in the first textview).

- Every time the user clicks the button, the number of coins needed to buy candy next time increases by 11. This means that after the button is clicked once, the number of coins needed to buy candy would be 11. Hence, this means that the button will need to be disabled again until the number of coins in the first textview is equal to or greater than 21.

- This keeps continuing as the user clicks on the imageView and the button.

I NEED THE CODE FOR THIS IN JAVA ANDROID STUDIO.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!