DatePicker is calling back its listener on init.
bug:3341515
1.Changed the callbeack registration to follow the spinners
initialization.
Change-Id: I3baff68c295993f975beec2b376af88e32b24e20
diff --git a/core/java/android/widget/DatePicker.java b/core/java/android/widget/DatePicker.java
index fce2449..dbcf1e9 100644
--- a/core/java/android/widget/DatePicker.java
+++ b/core/java/android/widget/DatePicker.java
@@ -471,8 +471,9 @@
*/
public void init(int year, int monthOfYear, int dayOfMonth,
OnDateChangedListener onDateChangedListener) {
- mOnDateChangedListener = onDateChangedListener;
updateDate(year, monthOfYear, dayOfMonth);
+ // register the callback after updating the date
+ mOnDateChangedListener = onDateChangedListener;
}
/**