title: How to Change the DatePickerDialog's Background Color from default White?
body: <p>I am trying to set the Dark Theme Style for the <code>DatePickerDialog</code> in Android. As per <a href="https://stackoverflow.com/questions/28738089/change-datepicker-dialog-color-for-android-5-0/28738461">Vikram's answer here</a>, I don't want to set style in <code>DatePickerDilog's</code> Constructor. </p>
  
  <p>I set the following styles &amp; it's set but doesn't apply to OK &amp; Cancel button's panel in Portrait mode. However, it works in Landscape!!:</p>
  
  <p>My v21/styles.xml:</p>
  
  <pre><code>&lt;style name="AppTheme.Dark.NoActionBar"&gt;
       &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
       &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
       &lt;item name="android:windowDrawsSystemBarBackgrounds"&gt;true&lt;/item&gt;
       &lt;item name="android:statusBarColor"&gt;@color/primaryColorDark_dark&lt;/item&gt;
       &lt;item name="android:datePickerDialogTheme"&gt;@style/DatePicker_Theme_Dark&lt;/item&gt;
  &lt;/style&gt;
  &lt;!--Dark DatePicker Theme &amp; style--&gt;
  &lt;style name="DatePicker_Theme_Dark" parent="android:Theme.Material.Light.Dialog"&gt;
      &lt;item name="android:datePickerStyle"&gt;@style/DatePicker_Dark&lt;/item&gt;
  &lt;/style&gt;
  &lt;style name="DatePicker_Dark" parent="@android:style/Widget.Material.Light.DatePicker"&gt;
      &lt;item name="colorAccent"&gt;@color/colorAccent_dark&lt;/item&gt;
      &lt;item name="android:background"&gt;@color/primaryColor_dark&lt;/item&gt;
      &lt;item name="android:headerBackground"&gt;@color/colorAccent_dark&lt;/item&gt;
      &lt;item name="android:textColorPrimary"&gt;@color/textPrimaryColor_dark&lt;/item&gt;
      &lt;item name="android:textColorSecondary"&gt;@color/textSecondaryColor_dark&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>My styles.xml:</p>
  
  <pre><code>&lt;!-- Dark Application theme --&gt;
  &lt;style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"&gt;
      &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
      &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
      &lt;item name="windowActionModeOverlay"&gt;false&lt;/item&gt;
  &lt;/style&gt;
  &lt;style name="AppTheme.Dark" parent="AppTheme.Base"&gt;
      &lt;item name="android:windowBackground"&gt;@color/backgroundColor_dark&lt;/item&gt;
      &lt;item name="colorAccent"&gt;@color/colorAccent_dark&lt;/item&gt;
      &lt;item name="android:textColorSecondary"&gt;@color/textSecondaryColor_dark&lt;/item&gt;
      &lt;item name="android:textColorPrimary"&gt;@color/textPrimaryColor_dark&lt;/item&gt;
      &lt;item name="android:datePickerStyle"&gt;@style/DatePicker_Dark&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="DatePicker_Dark" parent="Theme.AppCompat.Light.Dialog"&gt;
      &lt;item name="colorAccent"&gt;@color/colorAccent_dark&lt;/item&gt;
      &lt;item name="android:background"&gt;@color/primaryColor_dark&lt;/item&gt;
      &lt;item name="android:headerBackground"&gt;@color/colorAccent_dark&lt;/item&gt;
      &lt;item name="android:textColorPrimary"&gt;@color/textPrimaryColor_dark&lt;/item&gt;
      &lt;item name="android:textColorSecondary"&gt;@color/textSecondaryColor_dark&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>In my .java file, I am getting the new instance of the <code>DatePickerDialog</code> as follows:</p>
  
  <pre><code>return new DatePickerDialog(getActivity(), this, year, month, day){
      @Override
      public void onDateChanged(@NonNull DatePicker view, int year, int month, int dayOfMonth) {
            onDateSet(view, year, month, dayOfMonth);
            dismiss();
      }
   };
  </code></pre>
  
  <p>Snapshot:
  <a href="https://i.stack.imgur.com/ASnIg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ASnIg.png" alt="DatePicker"></a></p>
  
  <p>Your Help will be appreciated. Thanks!</p>