Created
September 30, 2017 06:59
-
-
Save fida1989/ccb027e3afc3beb6fee68e898509c2d8 to your computer and use it in GitHub Desktop.
Alert Dialog Box or Confirmation Box in Android Read more: http://www.androidhub4you.com/2012/09/alert-dialog-box-or-confirmation-box-in.html#ixzz4u8vnid4B
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AlertDialog.Builder builder = new AlertDialog.Builder(context); | |
builder | |
.setMessage("Are you sure?") | |
.setPositiveButton("Yes", new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int id) { | |
// Yes-code | |
} | |
}) | |
.setNegativeButton("No", new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog,int id) { | |
dialog.cancel(); | |
} | |
}) | |
.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment