Hiii, what difference will it make if 1)We end our application by calling notifyDestroyed()only and not call desroyApp(true) 2)or only call destroyApp(true). 3)or call notifyDestroyed() and destroyApp(true) as well.
What is the best way to terminate our Application?
It is important to understand the relationship between the destroyApp( ) and notifyDestroyed( ) methods and when they are used:
1. When the MIDlet is being destroyed by the platform, most likely because the user has requested it, the MIDlet's destroyApp( ) method is called with the argument true, and the MIDlet is destroyed when this method completes. It is not necessary in this case for the MIDlet to invoke its notifyDestroyed( ) method.
2. When the MIDlet itself wants to terminate, typically because it has no more useful work to do or the user has pressed an Exit button, it can do so by invoking its notifyDestroyed( ) method, which tells the platform that it should be destroyed. In this case, the platform does not call the MIDlet's destroyApp( ) method; it assumes that the MIDlet is already prepared to be terminated. Most MIDlets invoke their own destroyApp( ) method to perform the usual tidy up before calling notifyDestroyed( ), as shown earlier
desroyApp(true) call from your application, to terminate the application. Where as notifyDestroyed() call by AMS(Application Managament software(i.e by your system)) which used to inform your appliaction that your application is going to terminate.