How to display a Yes/No dialog box on Android?

Yes, I know there’s AlertDialog.Builder, but I’m shocked to know how difficult (well, at least not programmer-friendly) to display a dialog in Android.

I used to be a .NET developer, and I’m wondering is there any Android-equivalent of the following?

if (MessageBox.Show("Sure?", "", MessageBoxButtons.YesNo) == DialogResult.Yes){
    // Do something...
}

17 Answers
17

Leave a Comment