Technically, setCommandListener() is "valid" for Alert in MIDP-1.0, as the method is inherited from Displayable. But the Alert class in MIDP-1.0 overrides this method something like:
Code:
public void setCommandListener (CommandListener listener) {
throw new IllegalStateException ();
}
and the API documentation says "this method will always throw IllegalStateException whenever it is called".
The ability to use this method to add a CommandListener to an Alert is new in MIDP-2.0 - in MIDP-1.0 there is no way to do this.
To the best of my knowledge, there is no way to terminate a thread, other than for it to complete its run() method.
The setCurrent() method of Display can be used to tell the Display to display another screen after the Alert has been dismissed (or times-out). I guess your problem is knowing when this has happened (without a commandAction event). If your next screen is a Canvas, you should get showNotify() and paint() events. Otherwise, the only noticably change would be that the new screen's isShown() method will return true. If your thread is able to check this method, that may be an option. Otherwise, you may have to instruct the thread to end before the Alert is shown.
If none of this helps, then perhaps you could describe the underlying problem? (For example, what the thread is doing, and in what circumstances you need it to terminate.)
Graham.