The dialog builder

As well as being essential to all but a few apps, Android dialogs offer a great way to see how the framework itself employs design patterns. In this case, it is the dialog builder, which strings together a series of setters to build our dialog.

In the current situation, all we really need is a very simple dialog allowing the user to confirm their selection, but dialog construction is a very interesting topic and so we will take a closer look at how it is done and how inbuilt builder patterns are used to construct them.

The dialog we are about to build will, if confirmed, take the user to another activity, so before we do that we should create that activity. This is easily done by selecting New | Activity | Blank Activity from ...

Get Android Design Patterns and Best Practice now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.