Forked from marcelohd/AlertDialog.Builder Android
Last active
August 29, 2015 14:11
-
-
Save dp-singh/e53592fa8b8e4739a97a to your computer and use it in GitHub Desktop.
This file contains 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
AlertDialog.Builder builder = new AlertDialog.Builder(Activity.this); | |
builder.setTitle("Delete") | |
.setIcon(android.R.drawable.ic_dialog_alert) | |
.setMessage("Do you want to delete?") | |
.setCancelable(false) | |
.setPositiveButton("Yes", new DialogInterface.OnClickListener() { | |
public void onClick(DialogInterface dialog, int id) { | |
DAO dao = new DAO(Activity.this); | |
dao.deleteValues(valueSelected); | |
dao.close(); | |
} | |
}) | |
.setNegativeButton("No", new DialogInterface.OnClickListener() { | |
public void onClick(DialogInterface dialog, int id) { | |
dialog.cancel(); | |
} | |
}); | |
builder.show(); | |
return false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment