Search code examples
androiddatepickerfragmentandroid-datepicker

Double header bar on Android DatePicker when fragments are reopened


I'm running into this weird bug when using the DatePicker Dialog in Android where I get a secondary title bar. It only happens when I select a date, leave the fragment, then return to it. I'm doing nothing different when I create a new instance of the fragment, except for checking my state machine for the last selected date (if null I pass in a new Date())

enter image description here

I'm wondering why this additional bar at the top of the DatePicker shows up, and why it would only show up in a certain scenario.

How to Remove header Title from the DatePickerDialog ?


Solution

  • In your DatePickerDialog.

    use datePickerDialog.setTitle(""); it will hide the Title which you called as Double header bar.