1

I want to remove the extra background in DatePickerDialog

enter image description here

This is my code

DatePickerDialog dpd = new DatePickerDialog(RegisterActivity.this, android.R.style.Theme_Holo_Dialog, date,
                        myCalendar.get(Calendar.YEAR), myCalendar.get(Calendar.MONTH),
                        myCalendar.get(Calendar.DAY_OF_MONTH));
byteC0de
  • 5,153
  • 5
  • 33
  • 66
  • 2
    Possible duplicate of [DatePickerDialog displays with two borders](http://stackoverflow.com/questions/25205161/datepickerdialog-displays-with-two-borders) – Mike M. Oct 25 '16 at 10:29

1 Answers1

1

You can override the dialog theme like this :

<style name="TransparentDatePickerDialogTheme" parent="AlertDialog.AppCompat">
    <item name="android:windowBackground">@android:color/transparent</item>
</style>

then apply the theme like this

DatePickerDialog dpd = new DatePickerDialog(RegisterActivity.this, R.style.TransparentDatePickerDialogTheme, date,
                    myCalendar.get(Calendar.YEAR), myCalendar.get(Calendar.MONTH),
                    myCalendar.get(Calendar.DAY_OF_MONTH));
François Legrand
  • 1,151
  • 1
  • 14
  • 25