Interface CommandListener

public interface CommandListener

This interface is used by applications which need to receive high-level events from the implementation. An application will provide an implementation of a CommandListener (typically by using a nested class or an inner class) and will then provide the instance to the addCommand method on a Displayable in order to receive high-level events on that screen.

The specification does not require the platform to create several threads for the event delivery. Thus, if a CommandListener method does not return or the return is not delayed, the system may be blocked. So, there is the following note to application developers:

MIDP 1.0
See Also:

Method Summary
 void commandAction(Command c, Displayable d)
          Indicates that a command event has occurred on Displayable d.

Method Detail


void commandAction(Command c,
                   Displayable d)
Indicates that a command event has occurred on Displayable d.

c - a Command object identifying the command. This is either one of the applications have been added to Displayable with addCommand(Command) or is the implicit SELECT_COMMAND of List.
d - the Displayable on which this event has occurred


Send a comment or suggestionVersion 3.0 of Mobile Information Device Profile Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-2009 Motorola Inc. Portions copyright 1993-2002 Sun Microsystems, Inc. and Motorola, Inc. All Rights Reserved.