Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove Title from DatePickerDialog

For some reason, I have two titles in my DatePickerDialog.

[Screenshot](http://i.imgur.com/8rVEjlv.png)

How can I get rid of the white title at the top? This is the code I use to create the Dialog:

datePickerDialog = new DatePickerDialog(ProfileActivity.this, this, year, month, day);
datePickerDialog.getDatePicker().updateDate(year, month - 1, day);
datePickerDialog.show();
like image 450
Alex Avatar asked Nov 02 '15 20:11

Alex


2 Answers

datePickerDialog.setTitle("");
like image 181
Shrey Avatar answered Nov 01 '22 14:11

Shrey


I found that for myself: datePickerDialog.getDatePicker().setMaxDate(c.getTimeInMillis());

and probably for you: datePickerDialog.getDatePicker().updateDate(year, month - 1, day);

is the culprit. If you leave that line out, you won't have a title.

I'm looking into setting a specific theme tosolve the issue.

-- UPDATE --

Make sure you call .setTitle(""); AFTER you call .getDatePicker().x(). Otherwise it will not work.

like image 39
Spoetnic Avatar answered Nov 01 '22 13:11

Spoetnic