I have a default warning dialog with a list of Text and Radio buttons.
I need to replace the image instead of text (replace the image instead of Facebook, credit card, PayPal, credit card shown below), and also change the background color of the dialog box.
I also put the style.xml file inside the values folder.
How can I implement this file in the below code to change the background color?
My code is:
final CharSequence[] items = {"Facebook credit", "Paypal", "Credit Card"};
AlertDialog.Builder builder = new AlertDialog.Builder(paymentPage.this);
builder.setTitle("Payment Gateway");
builder.setIcon(R.drawable.gate);
builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
}
});
builder.setPositiveButton("Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
payPalPayment();
}
});
builder.setNegativeButton("No",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Toast.makeText(paymentPage.this, "Fail", Toast.LENGTH_SHORT).show();
}
});
AlertDialog alert = builder.create();
alert.show();
}
});
My picture:

source
share