tags:

views:

253

answers:

2

notifyDestroyed() method is called by the MIDlet to notify AMS that it want to go to the Destroyed State. once this notification is received by the AMS, it will asssume that the MIDlet has already done all the resources clearing process before calling notifyDestroyed() method.

Therefore is it going to kill the MIDlet rather than calling destroyApp() method.

+1  A: 

It seems like it is best practice to call destroyApp() before notifyDestroyed().

try {
// Call destroyApp to release resources
destroyApp(false);
// Arrange for the MIDlet to be destroyed
notifyDestroyed();
} catch (MIDletStateChangeException ex) {
// MIDlet does not want to close
 }
Sean A.O. Harney
A: 

The AMS will definitely not call destroyApp() after notifyDestroyed() has been called.

An incorrect AMS that would do this could end up in a stack overflow situation when running a correct MIDlet.

QuickRecipesOnSymbianOS