
I have created 3 xml (layout) files for a little game.
There is the title screen/screen01 (with a "new game" button), the give-name-in screen/screen02 (with "back" and "ok" buttons (and a textentry-field)) and the overview screen/screen03 (also with "back" and "ok" buttons).
So, I want to connect these 3 screens, that i can navigate between these 3 screens.
For example:
- click "new game" button (screen01)
- click "back" button (screen02 - want to go back to the title screen)
- click again "new game" button (screen01)
- click "ok" button (screen02 - i typed my name in)
- click "back" button (screen03 - i noticed, i didn't type the correct name in ;D)
- and so on...
Ok, so i tried it with:
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
//my start title screen
setContentView(R.layout.screen01);
Button screen01_newgame_button = (Button) findViewById (R.id.screen01_newgame_button);
screen01_newgame_button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
setContentView(R.layout.screen02);
}
});
}
--> This works, but how can I i.e. navigate back to the title screen (screen01) or navigate to the overview screen (screen03) ???
--> Do I have to make a own class for each xml-file???
--> Or is it possible to do this navigation thing in one class???
I don't exactly know, but I think I need a own class for each xml file. The problem is, that i don't know how to connect these classes...
Excuse me for my terrible english
I know, it's very bad...

