How can I change the color of the button(s) in an AlertDialog in Android?
I wanted to solve this with themes rather than extra code since it feels cleaner to me to have all the styling-related stuff in the styles.xml. What I did was based on Arade's answer and this other question:
This will change the color of the button text of any alert dialog you create with style AlertDialogDanger. To do so:
new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.AlertDialogDanger))
.setMessage("Really delete?")
.setPositiveButton("Delete", null)
.setNegativeButton("Cancel", null)
.create().show();