AlertDialog Box In Android

Android AlertDialog can be used to display the dialog message with OK and Cancel buttons. It can be used to interrupt and ask the user about his/her choice to continue or discontinue.

Android AlertDialog is composed of three regions: title, content area and action buttons.

Android AlertDialog is the subclass of Dialog class.

Let’s see a simple example of Alert dialog box:

Activity_Main.Xml

Java Class :

Let’s write the code to create and show the AlertDialog.

MainActivity.JAva

Output :

AlertDialog Box

About Jaimin Patel

I am a Web Developer. I have been blogging and researching since 1 years and like to share my knowledge and research with the world. Peace..!!

View all posts by Jaimin Patel →

One Comment on “AlertDialog Box In Android”

Leave a Reply

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