Download





20.4 Exiting a MIDlet

The CLDC Specification states that a call to the method java.lang.System.exit is effectively equivalent to calling the method Runtime.getRuntime().exit. This means that in a CLDC program, calling the System.exit method will exit the virtual machine. However, since MIDP defines its own application model, this behavior is not desirable. For instance, it is not desirable that a single MIDlet in a MIDlet suite, upon exiting, would shut down the entire virtual machine (and therefore shut down the other MIDlets as well.) Rather, a well-behaved MIDlet should exit by calling the destroyApp and notifyDestroyed methods.

In order to prevent MIDP applications from accidentally shutting down the entire virtual machine, the MIDP Specification redefines the behavior of the system.exit method. In MIDP, calling this method will always throw a java.lang.SecurityException.


     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows