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
You say you call
notifyDestroyed()
when you press Left Soft Key? So, you have akeyPressed(int kc)
method that callsnotifyDestroyed()
?If yes, don't do it like that. The only place you should call
notifyDestroyed()
is in thedestroyApp()
method, after you've done whatever cleaning up you feel like doing. In yourkeyPressed()
method you should calldestroyApp(true)
instead.