Usually the Midlets (J2ME programs)
. MIDP applications differ from J2SE applications in the way they terminate. To terminate
your MIDlet, you only need to call the MIDlet's notifyDestroyed()
This signals the AMS that your MIDlet is done executing. The AMS destroys the MIDlet instance and all of its
objects. The VM still executes, however.
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
|1. ||View Comment|
In my Midlet class there is a constructor which instantiate an inner class. from the midlet a move to another java class, passing the midlet as parameter so as t be able to show what is in the java class like Display.getDisplay(midlet).setCurrent(form);
but now, from this java class, i want to switch the display to come back to the midlet, but it is actually causing errors
what should i do
Please hepl me
View Tutorial By: nicolas at 2011-11-12 21:35:58