FatalMIDlet.javaAPI DocphoneME MR2 API (J2ME)2895Wed May 02 18:00:16 BST


public class FatalMIDlet extends javax.microedition.midlet.MIDlet implements EventListener
Register an event listener, send an event to self, and throw a RuntimeException while processing an event.

Fields Summary
Constructors Summary
Methods Summary
public voiddestroyApp(boolean unconditional)
Does nothing.

unconditional is ignored

public voidpauseApp()
Pause; there are no resources that need to be released.

public booleanpreprocess(Event event, Event waitingEvent)
Preprocess an event that is being posted to the event queue. This method will get called in the thread that posted the event.

event event being posted
waitingEvent previous event of this type waiting in the queue to be processed
true to allow the post to continue, false to not post the event to the queue

        return true;
public voidprocess(Event event)
Process an event. This method will get called in the event queue processing thread.

event event to process

        throw new RuntimeException("fatal test error");
public voidstartApp()
Set up.

        EventQueue eventQueue;
        Event event;

        if (MIDletSuiteUtils.isAmsIsolate()) {
            // This is single VM mode don't throw a fatal error. Just end.

        eventQueue = EventQueue.getEventQueue();

        eventQueue.registerEventListener(EventTypes.TEST_EVENT, this);

        event = new Event(EventTypes.TEST_EVENT);;