14
Dialogs and DialogFragment

Dialogs demand attention and input from the user. They are useful for presenting a choice or important information. In this chapter, you will add a dialog in which users can change the date of a crime. Pressing the date button in CrimeDetailFragment will present this dialog (Figure 14.1).

Figure 14.1  A dialog for picking the date of a crime

A dialog for picking the date of a crime

The dialog in Figure 14.1 is an instance of DatePickerDialog, a subclass of AlertDialog. DatePickerDialog displays a date selection prompt to the user and provides a listener interface you can implement to capture the selection. For creating more custom dialogs, AlertDialog is the all-purpose Dialog subclass that you will use most often.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.166.131