I put in my app where you can show the dialog to exit the application, but the dialog is black. I wanted him to go white. How do I change the AlertDialog
theme?
@Override // SAIR DA APLICAÇÃO
public void finish() {
if (sair) {
AlertDialog.Builder alerta = new AlertDialog.Builder(this);
alerta.setTitle("Sair");
alerta.setIcon(R.mipmap.ic_launcher);
alerta.setMessage("Tem certeza de que deseja sair do xxxxx")
.setCancelable(false)
.setPositiveButton("SIM",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
sair = false;
finish();
}
})
.setNegativeButton("NÃO",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
dialog.cancel();
}
});
AlertDialog alertDialog = alerta.create();
alertDialog.show();
} else {
super.finish();
}
}