codearraydev / datetimepicker

Automatically exported from code.google.com/p/datetimepicker
0 stars 0 forks source link

Calendar mCalendar does not get updated when changing date with keyboard #4

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Change date/time with keyboard then hit ok
2. The listeners do not get triggered therefore not updating the value.
3.

What is the expected output? What do you see instead?

I expect the date/time I set using the keyboard to be updated

What version of the product are you using? On what operating system?

Android SDK 4.0.4/4.1.1

Please provide any additional information below.

Solution is easy if you add listeners for keyboard input and in the listeners 
you update the Calendar object values

Original issue reported on code.google.com by bashee...@gmail.com on 13 Feb 2013 at 5:20

GoogleCodeExporter commented 8 years ago
Sorry this seems to be an Android bug not something you're doing.

Original comment by bashee...@gmail.com on 13 Feb 2013 at 5:43

GoogleCodeExporter commented 8 years ago
For those interested, calling datepicker.clearFocus()/timepicker.clearFocus() 
when the OK button is clicked solves this problem.  Looking at the 
DatePickerDialog code helped me figure it out.

Original comment by bashee...@gmail.com on 13 Feb 2013 at 9:23

GoogleCodeExporter commented 8 years ago
For Android L its not updating the UI. but for Kitkat i have checked it works 
fine. is this the android Bug? or any other work around to fix this issue?

Solution: I have tried----> DatePicker datePicker = (DatePicker) 
mDateTimeDialogView.findViewById(R.id.DatePicker);

                // Init time picker
                TimePicker timePicker = (TimePicker) mDateTimeDialogView.findViewById(R.id.TimePicker);
                datePicker.clearFocus();
                timePicker.clearFocus(); 

then getting the values for Day, Year Month then its working!!!

But from DateTimePicker.class get(Calender.Year) not working!!! pls help.

Original comment by shishram...@gmail.com on 23 Dec 2014 at 5:48