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.

Easy Software Profits

Easy Software Profits

Here's How Anyone Can Start, Build and Run their Own Successful Software Empire Without Knowing the First Thing About Programming, Scripting Or Any 'Coder' Stuff. There is no doubt about it software sells. Software has a high percieved value and it solves problems for people.  A claim that can't always be made for PDF books, Video products and the like.

Get My Free Ebook

Post a comment