Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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");
    startActivity(intent);
}

how can i stop this, any help would be great

Cheers Daniel

share|improve this question
2  
This question should be migrated to stackoverflow. Also you should attach the stacktrace for the crash, otherwise it is hard to give any advice. – johlo Jul 23 '12 at 7:08
1  
Is your CUBEGameActivity declared in your manifest? – VinceFR Jul 23 '12 at 7:11
Yea it works the first time i press the button but the second time it crashes – Dan Jul 23 '12 at 7:33
what logcat says? – VinceFR Jul 25 '12 at 9:05

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.