Display “Warning” and “Alert” box messages in App Inventor apps
Whether you use Windows, Linux or Mac OS X applications, when the program needs to alert the user (you!) to an issue, the program displays a pop up dialog box with a warning or error message. You can easily create similar warning messages in App Inventor, as shown in this example screen:
To create a pop up warning dialog, use the Notifier control that appears in the Designer’s Palette:
Drag the Notifier icon into the app user interface design – the Notifier is used as a non-visible component, just below the user interface:
Switch to the Blocks view, click on the Notifier1 block to view the available methods. A partial list of methods is shown here – the item circled in red is the one we will use in this example:
In response to an on screen button press (btnNotifyUser’s Click event), the app displays the dialog message:
This block can be inserted anywhere a processing block is allowed such as the result of an if-then-else conditional block. You can also change the text or background color of the app to something more interesting than the “black and white” default colors shown in this example.
Notifier provides a quick and easy way to display short alert messages to the user of the app.