令人惊讶的是,终止 midlet 在我的应用程序中不起作用。也许是因为我使用的是线程,但destroyApp()
还notifyDestroyed()
不够。
以下面的代码为例:
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);
}
}