Force-commit changes on accept in spinner-style DatePickerDialog

Bug: 19005472
Change-Id: If500c7305282a5055b4617c242871e04d91c0bc3
This commit is contained in:
Alan Viverette
2015-01-13 17:34:17 -08:00
parent ea002666cf
commit b2b98a00e1

View File

@@ -131,6 +131,9 @@ public class DatePickerDialog extends AlertDialog implements OnClickListener,
switch (which) {
case BUTTON_POSITIVE:
if (mDateSetListener != null) {
// Clearing focus forces the dialog to commit any pending
// changes, e.g. typed text in a NumberPicker.
mDatePicker.clearFocus();
mDateSetListener.onDateSet(mDatePicker, mDatePicker.getYear(),
mDatePicker.getMonth(), mDatePicker.getDayOfMonth());
}