Often, we will want to show the user some information or perhaps ask for confirmation of an action in a pop-up window. This is known as a dialog window. If you quickly scan the palette, you might be surprised to see no mention of dialogs whatsoever.
Dialogs in Android are more advanced than a simple widget or even a layout. They are classes that can contain layouts and widgets of their own.
The best way to create a dialog window in Android is to use the
Fragment
class. Fragments are a wide and vital topic in Android, and we will spend much of the second half of this book exploring and using them.
Creating a neat pop-up dialog for our user to interact with, however, is a great introduction to fragments and not too complicated at all.