"Introduction to Java Mobile/PDA Programming" Reading notes 5--lcdaui Advanced API alert

Source: Internet
Author: User
Tags join
Notes | program | advanced | design
AlertType is a tool class and cannot be instantiated by itself. It provides several well-defined alertytpe to assist with the alert class. Includes: ALARM Alert confirmation Identify error Error info provide information warning warning

Warning Tone: Display display; AlertType.ALARM.playSound (display); AlertType.CONFIRMATION.playSound (display); AlertType.ERROR.playSound (display); AlertType.INFO.playSound (display); AlertType.WARNING.playSound (display);

Alert uses display's setcurrent () to make it appear on the screen at the moment, it will first make a sound, and then display itself on the screen, after a period of time, automatically jump back to the previous page.

If alert is the first screen display, you must use Setcommandlistener () to set event handling, or an error message will occur.

Constructor: With one argument-the caption can take four parameters-title, text, image, type. The SetType ()/gertype () setstring ()/getstring () setimage () is the action function for the above parameters.

You can use the settimeout () function to pass in the Alert.forever as a parameter to prevent alert from automatically jumping back to its original feature over time. This must be handled manually by the user.

We can add a system menu item using AddCommand (), and if alert itself does not join any command, its static member Dismiss_command will be the only system menu item. Once we join our own Command,dismiss_command will not appear. After Removecommand () deletes the command in all alert, Dismiss_command appears again to ensure that at least one of the options on alert is available.

Setcommandlistener () is used to register the alert event. Without any incident, a little press is going back to the previous page.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.