Jump to content

Problem With Recreating An Activity Android

Recommended Posts

I am making a android game and at the moment i am working on a simple menu, this menu has 2 buttons one that generates a random map and lets you play it and one that takes you to a list of pre made levels. The problem is that if i press the random map button and run the game activity if i press the back button to return to the menu activity and try to play a random game again it crashes

The following is the function that gets called when you press the random map button

public void playRandom( View view )
Intent intent = new Intent(this, CUBEGameActivity.class);
intent.putExtra(EXTRA_MESSAGE, "RANDOM");

how can i stop this, any help would be great

Cheers Daniel

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...