Created
May 29, 2017 21:13
-
-
Save ltpitt/6fd371a466a8b04a7350db90b4845a18 to your computer and use it in GitHub Desktop.
A simple AlertDialog in Android
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 alertDialog = new AlertDialog.Builder(MainActivity.this).create(); | |
| alertDialog.setTitle("Alert"); | |
| alertDialog.setMessage("Alert message to be shown"); | |
| alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", | |
| new DialogInterface.OnClickListener() { | |
| public void onClick(DialogInterface dialog, int which) { | |
| dialog.dismiss(); | |
| } | |
| }); | |
| alertDialog.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment