J2ME "notifyDestroyed()" is not working properly on Nokia 501

171 views Asked by At

I am writing a game using J2ME. I am having a problem in notifyDestroyed() method.
When I exit the game from main menu it shows me exit confirmation screen I created, when I say yes by pressing LSK (Left Soft Key) where I have called the notifyDestroyed() method, Game dose not exit. This is my code called on LSK

protected void destroyApp(boolean arg0) throws MIDletStateChangeException
{
 notifyDestroyed();
}

I have implemented only 1 thread in game,on the exit,I have Removed sounds, RMS, and have unloaded all the resources but still its not working

This is working correctly for other devices (Samsung,Motorola,BB,LG )of mine except Nokia Asha 501. Can anybody help me how to solve this issue? Thank you

1

There are 1 answers

0
mr_lou On BEST ANSWER

You say you call notifyDestroyed() when you press Left Soft Key? So, you have a keyPressed(int kc) method that calls notifyDestroyed()?

If yes, don't do it like that. The only place you should call notifyDestroyed() is in the destroyApp() method, after you've done whatever cleaning up you feel like doing. In your keyPressed() method you should call destroyApp(true) instead.