Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d20c846 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

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
parent 38f79d01
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;