Skip to content

Instantly share code, notes, and snippets.

@fida1989
Created September 30, 2017 06:59
Show Gist options
  • Save fida1989/ccb027e3afc3beb6fee68e898509c2d8 to your computer and use it in GitHub Desktop.
Save fida1989/ccb027e3afc3beb6fee68e898509c2d8 to your computer and use it in GitHub Desktop.
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder
.setMessage("Are you sure?")
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
// Yes-code
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,int id) {
dialog.cancel();
}
})
.show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment