Created
August 19, 2016 13:07
-
-
Save MaximAlien/7b14d2e84644e04016778a013814ad21 to your computer and use it in GitHub Desktop.
[Android] Code which creates AlertDialog on Android
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 dialog = new AlertDialog.Builder(this).setMessage("Title") | |
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int which) { | |
dialog.dismiss(); | |
} | |
}).setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int which) { | |
dialog.dismiss(); | |
} | |
}).create(); | |
dialog.setCancelable(false); | |
dialog.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment