how to add two alertdialog button in android

0 1,192

 alert dialog button in android

In this tut, I will show you how you can add two buttons in an alert dialog.For two alertdialog button In main  we have one onclick method Showalert .in this method we have used AlertDialog.Builder to create our dialog box interface this interface shows us buttons and title with message.


In activity_mian.xml we have a one simple xml layout which contain a Button and onClick attribute.


In string.xml we have two string values appname and Label to define app name and label for a button.

Download source code




Leave A Reply

Your email address will not be published.