Introducing Dialogs

Dialog boxes are a common UI metaphor in desktop, web, and mobile applications. They're used to help users answer questions, make selections, and confirm actions, and to display warning or error messages. Dialog boxes in Android are partially transparent, floating Activities that partially obscure the Activities that launched them.

As in Figure 5-5, they generally obscure the Activities behind them using a blur or dim filter.

There are three ways to implement a dialog in Android:

> Using the Dialog class (or its extensions) As well as the general-purpose AlertDialog class, Android includes a number of specialist classes that extend Dialog. Each is designed to provide specific dialogbox functionality. A Dialog-class-based screen is constructed entirely within its calling Activity, so it doesn't need to be registered in the manifest as its life cycle is controlled entirely by the calling Activity.

> Dialog-themed Activities You can apply the dialog theme to a regular Activity to give it the appearance of a standard dialog box.

> Toasts Toasts are special non-modal transient message boxes, often used by Broadcast Receivers and Services to notify users of events occurring in the background. You can learn more about Toasts in Chapter 9.

Iphone Apps Profit Formula

Iphone Apps Profit Formula

The Easy Formula To Making Money With Iphone Apps. The exemplary development of technology from then till now has helped everyone in all aspects of our lives. Essential factors including social, physical, mental, and the like have been touched by these mechanics making our existence so easier.

Get My Free Ebook


Post a comment