Custom Alert Box In Android

While creating an alert dialog,you need to make use of object of AlertDialogBuilder, which an inner class of AlertDialog.
Syntax

The syntax to set the positive (yes) or negative (no) button using the object of the AlertDialogBuilder class.

After creating and setting dialogbuilder we need to create and show the dialog,Like…

A sample with custom Alert Dialog:

main.xml

Create an xml with the customized look of the dialog and save it in drawable folder
customdialog.xml

MainActivity.java

3 thoughts on “Custom Alert Box In Android”

Leave a Reply

Your email address will not be published. Required fields are marked *