import javax.microedition.midlet.MIDlet; class BasicMIDlet extends MIDlet { public final void exit() { onExit(); notifyDestroyed(); } protected void startApp() { } protected void pauseApp() { } protected final void destroyApp(boolean uncond) { //throws MIDletStateChangeException { onExit(); } /* override onExit to provide clean-up code. */ protected void onExit() { } }