I had think that a Midlet is paused when it's brought background. And it's not running anymore there. Today, I read the javadoc of Display and it's seems my option was wrong. Can somebody give me some hints about: 1) When will a Midlet get background? 2) When will a Midlet get foreground? 3) When a Midlet get background, will it's pauseApp get called? 4) When a Midlet's pauseApp get called? 5) When a Midlet's startApp get called?
SCJP1.2<br />SCJD<br />SCMAD
Reghu Ram Thanumalayan
posted 9 years ago
My opinion is that even though the MIDlet is in background, it is could be either running, paused or the JVM itself could be preempted (the application would be suspended). All this is upto the device implementation.
From the MIDP 2.0 Spec, An application is said to be in the foreground if its current Displayable is actually visible on the display device and if user input device events will be delivered to it. If the application is not in the foreground, it lacks access to both the display and input devices, and it is said to be in the background.
Since the spec doesnt mention anything about what happens to the state of the midlet when this switching happens, it is upto the device implementation to take care of it.
Found this thread interesting, while searching for more info on this.