G'day everyone, welcome back.
Okay let's have a look at how we can add some dialogues to our app.
There's a Google guide to dialogues at https://developer.android.com/guide/topics/ui/dialogs.html
that's worth a read after you've watched these videos.
This document mentions three dialogue subclasses; AlertDialog, DatePickerDialog and TimePickerDialog.
Unless you want the user to select a date or a time, which we will be doing later,
you'd normally use an AlertDialog.
We'll be following the advice in this document, but I'm not going to read through it all here in the video.
There are a couple of things worth noting, though. Firstly, there's a link to a dialogs design guide,
in the design call-out at the top of the document.
That link describes the purpose and use of dialogs in a material design context.
It's well worth reading when you come to create your own.
There are some great examples of different dialog types, and advice on do's and don'ts when creating dialogs.
Okay, back to the dialogs guide.
There's a Contents box on the right hand side,
and I wanted to mention the Passing Events Back to the Dialog's Host link.
I won't go through this here, because we'll be covering it all in the videos,
but it's another example of how important callbacks and interfaces are in Android development.
Our dialog will let the user decide whether to perform an action or not.
To start with, we'll be asking our user to confirm the deletion of a task.
So we'll need some way for the calling activity to know which button was tapped, and for that we'll use callback.
The final thing I want to look at here is right at the end, dismissing a dialog.
I'll be coming back to this once our first dialog's written, so we can see the exact behaviour.
That will also explain how we know to code things the way we're going to.
In the next video, we'll create a general-purpose dialogue class for our app.
It'll let us use the same class, whenever we want the user to confirm an action.
See you in the next one.