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?
Try this code:
Code to delete an entry from the list
Call above method on delete button click
I have created a dialog for asking a Person whether he wants to call a Person or not.
You can create the dialog box using
AlertDialog.Builder
Try this:
To change the color of the positive & negative buttons of Alert dialog you can write the below two lines after
alertDialog.show();
Kotlin
Java