Defining Dialogs
You can define alert dialogs for a mobile application. A dialog is a pop-up window that displays over a view. An application can only have only one dialog open at a time.
To add a dialog, you add an AlertDialog object to the Dialogs container in the Outline Editor. When you add an AlertDialog object to the user interface, Mobile Development automatically adds an AlertDialogButton as a child object. An AlertDialog object requires at least one child AlertDialogButton object.
To define a dialog for a mobile application
2. In the Model section of the Outline Editor, expand the outline so that you view the Dialogs node.
3. Right-click the Dialogs node and select New Child > AlertDialog.
Mobile Development adds an AlertDialogButton child object as well.
4. Select the AlertDialog object, and in the Properties section of the Outline Editor set the properties for the dialog. For more information, see
AlertDialog Properties. Use the Text property to specify the text you want displayed in the dialog.
5. Select the AlertDialogButton object that Mobile Development added for you, and in the Properties section of the Outline Editor set the properties for the button. For more information, see
DialogButton Properties. 6. If you want the dialog to contain an additional button, right-click the AlertDialog object and select New Child > AlertDialogButton to add the button. Then select the button and set the properties. Repeat this step for each additional button you want in the dialog.
7. To use the dialog in the user interface, you can do one or more of the following:
Tip:
To update the Java classes that
Mobile Development generates for the project so that your changes are represented in the generated sources, save the project and regenerate sources. For instructions, see
Generating Sources for a Mobile Project.
Related Topics