Creating and Showing the Prompt Dialog

Finally, we finish up with steps 6 and 7: creating and showing the prompt dialog. That's easy to do once you have the alert-dialog builder (see Listing 5-25).

Listing 5-25. Telling the Alert-Dialog Builder to Create the Dialog //get the dialog

AlertDialog ad = builder.create();;

//return the prompt return pl.getPromptReply();

The last line uses the listener to return the reply for the prompt. Now, as promised, we'll show you the code for the PromptListener class.

0 0

Post a comment