Changed the example to use DialogFragment