3

I want to restrict a DatePickerDialog to a minimum value of tomorrow. When I put the code that I show below, the restriction works. However, title text containing the date appears like a header. How can I fix this?

This is my code:

 Calendar tempDate = Calendar.getInstance();
 tempDate.add(Calendar.DAY_OF_MONTH, 1);
 toDatePickerDialog.getDatePicker().setMinDate(tempDate.getTimeInMillis());

and the image:

a DatePickerDialog showing a title jue, 29 de dec. de 2016

Barett
  • 5,826
  • 6
  • 51
  • 55
Mickey Mouse
  • 107
  • 1
  • 11

2 Answers2

6

You can either manually set the title to an empty string, or you can request the dialog to have no title.

Former approach:

toDatePickerDialog.setTitle("");

Latter approach:

toDatePickerDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

Make sure to do either of these before you call toDatePickerDialog.show()

Muntaser Ahmed
  • 4,487
  • 1
  • 16
  • 17
0

you could fix that easily through the theme with windowNoTitle set to true.

Kosh
  • 6,140
  • 3
  • 36
  • 67