Change the background color of a pop-up dialog

To expand on @DaneWhite’s answer, you don’t have to rely on the built-in themes. You can easily supply your own style:

<style name="MyDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
    <item name="android:background">@color/myColor</item>

and then apply it in the Builder constructor:


AlertDialog alertDialog = new AlertDialog.Builder(getContext(),


var alertDialog = AlertDialog.Builder(context,

This should work whether you are using or

This also works better than @DummyData’s answer because you don’t resize the dialog. If you set window’s background drawable you overwrite some existing dimensional information and get a dialog that is not standard width.

If you set background on theme and the set the theme on dialog you’ll end up with a dialog that is colored how you want but still the correct width.

Leave a Comment