On the 4.2.2 version of the system called the Datepickerdialog, found that click OK when the system calls Ondateset () two times, you need to filter one of them.
Calendar Mcalendar = Calendar.getinstance (); Mcalendar.add (calendar.day_of_year, 1); final Datepickerdialog DateDialog = New Datepickerdialog (This, new Datepickerdialog.ondatesetlistener () { Boolean mfired = false; public void Ondateset (final DatePicker view, final int year, final int monthofyear, final int dayofmonth) { log.i ("PEW PEW "," Double Fire Check "); if (mfired = = True) { log.i ("Pew Pew", "Double fire occured". Silently-ish returning "); return; } else { //first time mfired mfired = true; } Normal Date picking logic goes here} }, Mcalendar.get (Calendar.year), Mcalendar.get (Calendar.month), Mcalendar.get (calendar.day_of_month));d atedialog.show ();
Reference: https://code.google.com/p/android/issues/detail?id=64895