How to quit / terminate / stop a j2me midlet?

Posted by hsmit on Stack Overflow See other posts from Stack Overflow or by hsmit
Published on 2010-04-25T12:05:05Z Indexed on 2010/04/25 12:13 UTC
Read the original article Hit count: 248

Filed under:
|
|
|

Surprisingly terminating a midlet doesn't work in my application. Maybe it is because I'm using Threads, but destroyApp() and notifyDestroyed() are not sufficient.

Take for example the following code:

protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
    System.out.println("destroying");
    notifyDestroyed();
}
protected void startApp() throws MIDletStateChangeException {
   try {
        // init modules
        controller.initialize();
    }catch (Exception e) {
        viewer.showAlert("error in startApp() init controller");
        destroyApp(true);
    }

}

© Stack Overflow or respective owner

Related posts about midlet

Related posts about java-me