Skip to content
Advertisement

how can i show a total score to the player screen not using a Toast

I made a higher lower game . if the player guess the number he get a specific number of points depending on how many tryes he had I wrote the code, i have the total but i dont know how to display it in a textview or plain text , anything but no toast. Here is the code:

JavaScript

here the total is showed in a Toast. I want it to be showed on the screen as a text permanently.

JavaScript

Advertisement

Answer

In your activity_main.xml add this TextView

JavaScript

In your MainActivity class in onCreate() method

JavaScript

Now set the total score to the textView

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement