Created
July 21, 2011 08:29
-
-
Save mbeaty/1096789 to your computer and use it in GitHub Desktop.
Simple Android Alert Dialog
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
public void showMessageDialog(String str) { | |
AlertDialog.Builder builder = new AlertDialog.Builder(this); | |
builder.setMessage(str); | |
builder.setCancelable(false); | |
builder.setNeutralButton("Ok", new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int which) { | |
dialog.dismiss(); | |
} | |
}); | |
AlertDialog alert = builder.create(); | |
alert.show(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment