alertBuilder android kotlin

Step 1: Create an AlertDialog.Builder object. Step 2: Set the title for the dialog using setTitle() method. Step 3: Set the message for the dialog using setMessage() method. Step 4: Set positive button using setPositiveButton() method. Step 5: Set negative button using setNegativeButton() method. Step 6: Create and show the dialog using create() and show() methods.