O'Reilly logo

Programming Wireless Devices with the Java™ 2 Platform, Micro Edition, Second Edition by Jim Holliday - Editor, Aleksi Uotila, Mark Patel, Jyri Huopaniemi, Jim Van Peursem, Antero Taivalsaari, Roger Riggs

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required