Java Reference
In-Depth Information
Figure 4-2. The MIDlet application life cycle
When the AMS creates a MIDlet, the MIDlet begins its life in the paused state. Only
once the AMS invokes the MIDlet's startApp method does the MIDlet enter the active
state; at this point, you can interact with it. This method isn't just the MIDlet's entry
point, however; the AMS invokes startApp whenever the MIDlet is about to enter the
active state.
At any point, the AMS can interrupt the MIDlet, forcing it to again enter the paused
state. The most common example of this is on wireless terminals when an incoming call
is received; of course, it also may happen on behalf of another event, such as an incom-
ing message, insufficient resources to perform a system task, and so on. Regardless of the
cause, the AMS invokes your MIDlet's pauseApp method. The pauseApp method should
release any shared resources and leave your MIDlet in a quiescent state, because the AMS
or device operating system will be bringing another application to the foreground.
 
Search WWH ::




Custom Search