For some reason, I have two titles in my DatePickerDialog.
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();
your should add datePickerDialog.getDatePicker().setMinDate(System.currentTimeMillis()); and then add datePickerDialog.setTitle("");
this type of sequence to remove top white background header
More appropriate so that it even supports holo versions
AlertDialog
havesetCustomHeader
method, using it and set a custom view withzero
width,zero
height. It will workI 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.