Name

AlertType

Synopsis

This is a class that provides a set of type-safe constants that are used to specify the type of an Alert. The AlertType provides a hint to the platform as to how it should render the Alert and typically causes an appropriate icon to be included along with the application-supplied message. On devices that have a sound capability, a sound (which might be type-dependent) may also be played when the alert is displayed.

The playSound() method may be used to play the sound associated with the AlertType, even when no Alert is displayed. Since not all devices will be able to play sounds, the playSound() method returns a boolean indicating whether a sound was produced, to allow the application to use an alternate mechanism to attract the user’s attention if sound is not available.

public class AlertType {  
// Protected Constructors
   protected AlertType();    
// Public Constants
   public static final AlertType ALARM;  
   public static final AlertType CONFIRMATION;  
   public static final AlertType ERROR;  
   public static final AlertType INFO;  
   public static final AlertType WARNING;    
// Public Instance Methods
   public boolean playSound( Display display);  
}

Passed To

Alert.{Alert(), setType()}

Returned By

Alert.getType()

Type Of

AlertType.{ALARM, CONFIRMATION, ERROR, INFO, WARNING}

Get J2ME in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.