Advertisement
obernardovieira

[Android] [AlertDialog] Single Button

Oct 7th, 2014
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. //thanks to William Tate --- http://stackoverflow.com/questions/5810084/android-alertdialog-single-button
  2.  
  3. AlertDialog.Builder builder = new AlertDialog.Builder(this);
  4. builder.setMessage("Look at this dialog!")
  5.        .setCancelable(false)
  6.        .setPositiveButton("OK", new DialogInterface.OnClickListener() {
  7.            public void onClick(DialogInterface dialog, int id) {
  8.                 //do things
  9.            }
  10.        });
  11. AlertDialog alert = builder.create();
  12. alert.show();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement