Your method WinnerScore
is almost there, you are just missing the update to the display. Create another TextView
to display this message, and simply update the content with the message. Note that capitalizing the first letter is usually reserved for class names, so you may want to get in the habit of lower-casing first letter of your method names.
On the side note, if you put r = new Random()
in OnCreate
it will only get called once. Put it as the first line inside the onClick
method. That way if you click on the roll button, the randomization will happens all the time. You also need to move or copy the displayFor
methods inside and at the end of the onClick
method so the score display gets updated accordingly.