Skip to content

Instantly share code, notes, and snippets.

@skatldjs
Created September 8, 2010 14:13
Show Gist options
  • Save skatldjs/570181 to your computer and use it in GitHub Desktop.
Save skatldjs/570181 to your computer and use it in GitHub Desktop.
AlertDialog.Builder builder
= new AlertDialog.Builder(this);
builder.setMessage(“Are you sure you want to exit?”)
.setCancelable(false)
.setPositiveButton(“Yes”,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
MyActivity.this.finish();
}})
.setNegativeButton(“No”, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}});
AlertDialog alert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment