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?
Try THIS link.
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
- the MIDlet should never call its own destroyApp() method
it is the system's job to do so when the MIDlet is stopped
by the system
- if the MIDlet wishes to terminate by its own will it must call
- Before calling notifyDestroyed() the same clean-up actions
as done in destroyApp() should be performed. The system will
not call destroyApp() after notifyDestroyed().
I provide a skeleton implementation below to illustrate this.
Read this link
its given with example.