Slide 3.12: Line-by-line anatomy of HelloMIDlet.java (cont.) Slide 3.14: User interface Home |
HelloMIDlet.java
(Cont.)
display.setCurrent(tbxMain);
Displayable
object.
It is the responsibility of the application to ensure that a Displayable
is visible and can interact with the user at all times.
Thus, the application should always call setCurrent( )
as part of its initialization.
The method public void javax.microedition.lcdui.Display.setCurrent (Displayable nextDisplayable) requests that a different Displayable
object be made visible on the display.
public void pauseApp( ) { }
public void destroyApp(boolean unconditional) { }
public void commandAction(Command c, Displayable s) {
Displayable d
.
if (c == cmdExit) {
Exit
command was selected.
destroyApp(false);
destroyApp( )
, which is empty in this case.
notifyDestroyed( );
Destroyed
state.
The JAM software will not call the MIDlet's destroyApp
method, and all resources held by the MIDlet will be considered eligible for reclamation.
The MIDlet must have performed the same operations (clean up, releasing of resources etc.) it would have if the MIDlet.destroyApp( )
had been called.