передать экземпляр мидлета и вызвать destroyApp(...)
или использовать notifyDestroyed();
.
Например,
Sample.java
public class Sample extends MIDlet {
public Sample() {
// do something
new Sample1(this); // pass the MIDlet to another class.
}
}
Sample1.java
public class Sample1 {
public Sample1(final MIDlet midlet) {
// do something
Command exitCmd = new Command("Exit") {
public void actionPerformed(ActionEvent evt) {
midlat.notifyDestroyed();
}
};
}
}