diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2011-01-17 11:04:08 -0800 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2011-01-17 11:04:18 -0800 |
commit | 3d20c846e45141acfbe9a56f0518ddb7a0bb4cf9 (patch) | |
tree | 89cb3089d88c1cbfb08ad1ade89ff35adf76213e | |
parent | 38f79d01db07f7cc3d3b49d594b675adfa8959d5 (diff) | |
download | frameworks_base-3d20c846e45141acfbe9a56f0518ddb7a0bb4cf9.zip frameworks_base-3d20c846e45141acfbe9a56f0518ddb7a0bb4cf9.tar.gz frameworks_base-3d20c846e45141acfbe9a56f0518ddb7a0bb4cf9.tar.bz2 |
Ensure that no callback is invoked while initializing DatePicker
bug:3360821
1. While my previous change:I3baff68c has partially fixed this bug
it was still possible for a callback to be invoked on init. If a
callback was already regitsered and the init is called the
callback is incorrectly notified.
Change-Id: I05c6cb78f4c7b7d2a00c52aef42c1698d9479be5
-rw-r--r-- | core/java/android/widget/DatePicker.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/java/android/widget/DatePicker.java b/core/java/android/widget/DatePicker.java index dbcf1e9..4d63cf4 100644 --- a/core/java/android/widget/DatePicker.java +++ b/core/java/android/widget/DatePicker.java @@ -471,6 +471,8 @@ public class DatePicker extends FrameLayout { */ public void init(int year, int monthOfYear, int dayOfMonth, OnDateChangedListener onDateChangedListener) { + // make sure there is no callback + mOnDateChangedListener = null; updateDate(year, monthOfYear, dayOfMonth); // register the callback after updating the date mOnDateChangedListener = onDateChangedListener; |