Force-commit changes on accept in spinner-style DatePickerDialog
Bug: 19005472 Change-Id: If500c7305282a5055b4617c242871e04d91c0bc3
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user