Skip to content

Instantly share code, notes, and snippets.

@mbeaty
Created July 21, 2011 08:29
Show Gist options
  • Save mbeaty/1096789 to your computer and use it in GitHub Desktop.
Save mbeaty/1096789 to your computer and use it in GitHub Desktop.
Simple Android Alert Dialog
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