I am making a simple app to learn Android at the same time, I am very much a newbie.
So far this is what i have:
the app opens into levels.java
which has 8 buttons (in an xml file), when button 8 is clicked,I have this code:
public void button_clicked8(View v) {
startActivity(new Intent(this, GameScreen.class));
}
which launches my gamescreen activity, after playing my simple addition game, I have a button that says "end" which calls a function with a finish()
in it, it also sets a variable gameover=true;
, this sends me back to levels.java
but if I press the button 8 again, it does send me to Gamescreen but I find that gameover=true;
is still set :(
Why is that? How do I start the activity "fresh"?
Thanks!