MID Profile

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 preceeding. 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 INFORMATION, WARNING, ERROR, ALARM, and CONFIRMATION.

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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INFO

public static final AlertType INFO
Alert for information.

WARNING

public static final AlertType WARNING
Alert for warning.

ERROR

public static final AlertType ERROR
Alert for error.

ALARM

public static final AlertType ALARM
Alert for alarm.

CONFIRMATION

public static final AlertType CONFIRMATION
Alert for confirmation.
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.

MID Profile

Submit a comment or suggestion Version 0.95 of MID Profile Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved.