By: Henry Printer Friendly Format
You want the VM to continue executing so other MIDlets can run. A call to System.exit() signals the VM to terminate. This behavior is undesirable in MIDP applications. Your applications should not terminate the VM; in fact, they can't. If your application calls System.exit(), a java.lang.SecurityException will always be thrown. You'll see a trace back that looks something like the following:
lifecycle does not support system exit.
There are two main reasons why a MIDlet should not shut down the VM. First, other applications may be running; terminating the VM would destroy them. Second, you never start up the VM; therefore, you should not shut it down. The AMS controls the VM. It starts it and terminates it when it detects it's not needed, or if it needs to manage system resources.
Most Viewed Articles (in J2ME )
Latest Articles (in J2ME)
Comment on this tutorial
- Data Science
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews