Created
November 1, 2014 19:13
-
-
Save NLKNguyen/3ce6c74758efc172dce4 to your computer and use it in GitHub Desktop.
Android/Java snippet
This file contains hidden or 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(this); | |
| builder.setMessage("Are you sure?"); | |
| builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() { | |
| @Override | |
| public void onClick(DialogInterface dialogInterface, int i) { | |
| dialogInterface.dismiss(); | |
| // Do something | |
| // ... | |
| // ... | |
| } | |
| }); | |
| builder.setNegativeButton("No", new DialogInterface.OnClickListener() { | |
| @Override | |
| public void onClick(DialogInterface dialogInterface, int i) { | |
| dialogInterface.dismiss(); | |
| } | |
| }); | |
| builder.create().show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment