javax.microedition.lcdui
Class AlertType

java.lang.Object
  |
  +--javax.microedition.lcdui.AlertType

public class AlertType
extends Object

The AlertType provides an indication of the nature of an Alert. Alerts are used by an application to present information to the user and wait before proceeding. An AlertType may also be used to directly signal the user without changing the display. 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.

Version:
MIDP 0.95 Public Draft

See Also:
Alert

Field Summary
static AlertType ALARM
          Alert for alarm.
static AlertType CONFIRMATION
          Alert for confirmation.
static AlertType ERROR
          Alert for error.
static AlertType INFO
          Alert for information.
static AlertType WARNING
          Alert for warning.
 
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALARM

public static final AlertType ALARM
Alert for alarm.

CONFIRMATION

public static final AlertType CONFIRMATION
Alert for confirmation.

ERROR

public static final AlertType ERROR
Alert for error.

INFO

public static final AlertType INFO
Alert for information.

WARNING

public static final AlertType WARNING
Alert for warning.
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