令人驚訝的是終止midlet在我的應用程序中不起作用。也許是因爲我使用的線程,但destroyApp()
和notifyDestroyed()
是不夠的。如何退出/終止/停止j2me midlet?
就拿下面的代碼:
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);
}
}
不幸的是,我沒有在http://stackoverflow.com/questions/1485943/question-for-terminate-app-in-j2me-but-it-doesnt-mean-quit-from-application找到解決方案。 – hsmit 2010-04-25 12:14:10