Alert Dialog background theme/Color

Create your style in your styles.xml file as follows.

<style name="AlertDialogCustom" parent="@android:style/Theme.Dialog">
        <item name="android:textColor">@color/White</item>
        <item name="android:textStyle">bold</item>
        <item name="android:headerDividersEnabled">true</item>
        <item name="android:typeface">normal</item>
        <item name="android:background">@color/colorPrimaryDark</item>
    </style>

Then Create Alert Dialog using Builder as follows

AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(this/getActvity(), R.style.AlertDialogCustom));

Here passing the current class Context and style to the ContextThemeWrapper class constructor.


You should add dialog style inside res/values/styles.xml. Like as below.

<style name="MyDialog" parent="@android:style/Theme.Holo.Light.Dialog">
        <item name="android:background">@color/white</item>
    </style>

Or you change background color as below also:

EDIT:

 getWindow().setBackgroundDrawableResource(R.color.white);