I want to remove the black background on custom dialog as shown in the picture. I\'m sure the black background was from the dialog, not from app\'s background.
I had the same problem with my custom dialog based on the Alertdialog.Builder, which had a black background showing in the title and the body when i use:
builder.setView(rootView)
.setTitle(dialog_title)
.setMessage(dialog_mesg)
solution was 1- Use one of the pre-defines alert dialog builder's themes:
THEME_DEVICE_DEFAULT_LIGHT worked best for me
2 - set the default dialog button (positive / negative) colors to which ever color you desire like so:
Button b = mAlertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
Button d = mAlertDialog.getButton(AlertDialog.BUTTON_NEGATIVE);
b.setTextColor(ContextCompat.getColor(getActivity(), R.color.primary));
d.setTextColor(ContextCompat.getColor(getActivity(), R.color.primary));
check the below blog post for more detail and tricks to theming options: http://blog.supenta.com/2014/07/02/how-to-style-alertdialogs-like-a-pro/
tested on Oreo 8.1