you need a static MIDlet variable for less memory space, for example, create a Env class as the following:
public class Env {
public static MIDlet midlet;
public Env(MIDlet yourmainclass) {
midlet = yourmainclass;
}
}
and in other procedure, you can do this to close the application
Env.midlet.notifyDestroyed();