Created
February 7, 2016 23:32
-
-
Save tyaslab/a5699e8f69a8cdd9f558 to your computer and use it in GitHub Desktop.
Android Snippet - AlertDialog
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(getDialogContext()); | |
builder.setMessage("Message"); | |
builder.setPositiveButton("Yes", new Dialog.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int which) { | |
Toast.makeText(this, "Yes", Toast.LENGTH_SHORT).show(); | |
dialog.cancel(); | |
} | |
}); | |
builder.setNegativeButton("No", new Dialog.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int which) { | |
Toast.makeText(this, "Yes", Toast.LENGTH_SHORT).show(); | |
dialog.cancel(); | |
} | |
}); | |
builder.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment