javax.microedition.lcdui
Class AlertType

java.lang.Object
  extended by javax.microedition.lcdui.AlertType

public class AlertType
extends Object

The AlertType provides an indication of the nature of alerts. Alerts are used by an application to present various kinds of information to the user. An AlertType may be used to directly signal the user without changing the current Displayable. The playSound method can be used to spontaneously generate a sound to alert the user. For example, a game using a Canvas can use playSound to indicate success or progress. The predefined types are INFO, WARNING, ERROR, ALARM, and CONFIRMATION.

See Also:
Alert

Field Summary
static AlertType ALARM
          An ALARM AlertType is a hint to alert the user to an event for which the user has previously requested to be notified.
static AlertType CONFIRMATION
          A CONFIRMATION AlertType is a hint to confirm user actions.
static AlertType ERROR
          An ERROR AlertType is a hint to alert the user to an erroneous operation.
static AlertType INFO
          An INFO AlertType typically provides non-threatening information to the user.
static AlertType WARNING
          A WARNING AlertType is a hint to warn the user of a potentially dangerous operation.
 
Constructor Summary
protected AlertType()
          Protected constructor for subclasses.
 
Method Summary
 boolean playSound(Display display)
          Alert the user by playing the sound for this AlertType.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

INFO

public static final AlertType INFO
An INFO AlertType typically provides non-threatening information to the user. For example, a simple splash screen might be an INFO AlertType.


WARNING

public static final AlertType WARNING
A WARNING AlertType is a hint to warn the user of a potentially dangerous operation. For example, the warning message may contain the message, "Warning: this operation will erase your data."


ERROR

public static final AlertType ERROR
An ERROR AlertType is a hint to alert the user to an erroneous operation. For example, an error alert might show the message, "There is not enough room to install the application."


ALARM

public static final AlertType ALARM
An ALARM AlertType is a hint to alert the user to an event for which the user has previously requested to be notified. For example, the message might say, "Staff meeting in five minutes."


CONFIRMATION

public static final AlertType CONFIRMATION
A CONFIRMATION AlertType is a hint to confirm user actions. For example, "Saved!" might be shown to indicate that a Save operation has completed.



Constructor Detail

AlertType

protected AlertType()
Protected constructor for subclasses.



Method Detail

playSound

public boolean playSound(Display display)
Alert the user by playing the sound for this AlertType. The AlertType instance is used as a hint by the device to generate an appropriate sound. Instances other than those predefined above may be ignored. The actual sound made by the device, if any, is determined by the device. The device may ignore the request, use the same sound for several AlertTypes or use any other means suitable to alert the user.

Parameters:
display - to which the AlertType's sound should be played.
Returns:
true if the user was alerted, false otherwise.
Throws:
NullPointerException - if display is null





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.