I would recommend using DialogFragment
.
Sure, creating a "Yes/No" dialog with it is pretty complex considering that it should be rather simple task, but creating a similar dialog box with Dialog
is surprisingly complicated as well.
(Activity lifecycle makes it complicated - you must let Activity
manage the lifecycle of the dialog box - and there is no way to pass custom parameters e.g. the custom message to Activity.showDialog
if using API levels under 8)
The nice thing is that you can usually build your own abstraction on top of DialogFragment
pretty easily.