O'Reilly logo

Android Design Patterns and Best Practice by Kyle Mew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required