Created
May 23, 2012 22:45
-
-
Save marcelohd/2778309 to your computer and use it in GitHub Desktop.
AlertDialog.Builder Android
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