# Game states vs calling new activities

I am trying to decide what the best method is to call "level complete-screen" and "game over-screen" in my real-time android 2d game. Currently I am using game-states and only updating my game when its in gamestate==GAMEPLAY, but this sometimes makes resetting some stuff awkward. Another method I have tried is calling a new activity during real-time using context, like this:

public void startMenu() {
final Context context = this.getContext();
public void run() {
try {
} catch (InterruptedException e) {
e.printStackTrace();
}
// Context context = getContext();
intent.putExtra("level", level);
((Activity) context).startActivity(intent);
}
});


This method calls another activity during real-time from a View-class. But it seems a bit clumsy and forced. Just want to know if there is a preferred way to call these screens in real-time games?

• Are you looking for best practices? Keeping the code tidy? What is the main goal? How does the game over screen look? – wolfdawn Jan 24 '14 at 10:29
• Best practices. Its just a screen where u can see score and choose to restart or go to menu. – Green_qaue Jan 24 '14 at 10:42
• Could you elaborate on this: "this sometimes makes resetting some stuff awkward". Did you implement a function to reset everything? What problems occurred? It sounds like you are using the new activity where it may be unneeded to overcome an issue with design that cause the complication in resetting stuff. – wolfdawn Jan 24 '14 at 11:13
• Im sorry for the poor explenation. At work so had to rush it. Will elaborate later! – Green_qaue Jan 24 '14 at 11:53