My application was working perfectly on my Android 2.2 emulator. I then decided to test on an Android 4.1 emulator. The DatePickerDialog
looks a little different and for some reason when I press on "Done", the onDateSet()
listener gets called twice and causes problems in my application.
I know this because the log shown below in the code is printed twice whenever I click on "Done"
mDateSetListener = new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
Log.v("onDateSet", "ENTERED");
//rest of code...
}};
Android 2.2 DatePicker
Android 4.1 DatePicker