How do I display an alert dialog on Android?

I want to display a dialog/popup window with a message to the user that shows “Are you sure you want to delete this entry?” with one button that says ‘Delete’. When Delete is touched, it should delete that entry, otherwise nothing.

I have written a click listener for those buttons, but how do I invoke a dialog or popup and its functionality?

3
37

Leave a Comment