| java.lang.Object javax.microedition.lcdui.AlertType
AlertType | public class AlertType (Code) | | 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 since: MIDP 1.0 |
Field Summary | |
final public 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. | final public static AlertType | CONFIRMATION A CONFIRMATION AlertType is a
hint to confirm user actions. | final public static AlertType | ERROR An ERROR AlertType is a hint
to alert the user to an erroneous operation. | final public static AlertType | INFO An INFO AlertType typically
provides non-threatening information to the
user. | final public 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. | | AlertType(int type) |
Method Summary | |
int | getType() | 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. |
ALARM | final public static AlertType ALARM(Code) | | 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 | final public static AlertType CONFIRMATION(Code) | | A CONFIRMATION AlertType is a
hint to confirm user actions.
For example, "Saved!" might be shown to indicate that a Save
operation has completed.
|
ERROR | final public static AlertType ERROR(Code) | | 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."
|
INFO | final public static AlertType INFO(Code) | | An INFO AlertType typically
provides non-threatening information to the
user. For example, a simple splash screen might be an
INFO AlertType .
|
WARNING | final public static AlertType WARNING(Code) | | 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."
|
AlertType | protected AlertType()(Code) | | Protected constructor for subclasses.
|
AlertType | AlertType(int type)(Code) | | Create a new AlertType given the type identifier
Parameters: type - The type of the new AlertType |
getType | int getType()(Code) | | Get the type of this AlertType
int The typer identifer of this AlertType, one of:ALERT_INFO, ALERT_WARN, ALERT_ERR, ALERT_ALRM, ALERT_CFM |
playSound | public boolean playSound(Display display)(Code) | | 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 soundshould be played. true if the user was alerted,false otherwise. exception: NullPointerException - if display is null |
|
|