| When the application management software has determined that the
MIDlet is no longer needed, or perhaps needs to make room
for a higher priority application in memory, is signals
the MIDlet
that it is a candidate to be destroyed by invoking the
destroyApp(boolean) method. In this case, we need to destroy
the RecordEnumeration s so that we don't waste their memory
and close the open RecordStore s. If the
RecordStore s
are empty, then we do not need them to be stored as
they will be recreated
on the next invokation of the MIDlet so
we should delete them.
At the end of our clean up, we must call notifyDestroyed
which will inform the application management software that we are done
cleaning up and have finished our execution and can
now be safely terminated and
enters the Destroyed state.
Parameters: unconditional - If true when this method is called,the MIDlet mustcleanup and release all resources. If false the MIDlet may throw MIDletStateChangeException to indicate itdoes not want to be destroyed at this time. MIDletStateChangeException is thrown if the MIDlet wishes to continue toexecute (Not enter the Destroyed state). Thisexception is ignored if unconditional is equalto true. See Also: javax.microedition.midlet.MIDlet |