Globale variable for all classes
I'm making a game, and i want some help, so if someone can help me? it would be helpfull! :D
i have more than 1 question so i hope i can talk to him in private chat.
but one of my question is, i want to make a integer score; for counting the score.. logic.
and i made in one class the mainscreen, and in another class the screen where you can get the points.
so i made in mainscreen a textview that displays the score. And a button to go to the other screen. When i got to the other screen and i push a button, i need to do: score = score + 1; but how to attach score in another screen / class?
Hope you can answer my question! Thanks!
Re: Globale variable for all classes
Originally Posted by MichaelC
have you used sharedpreference that is global variable
you used this logic and create variable then use all class on between your project...