GoogleDateTimePickers icon indicating copy to clipboard operation
GoogleDateTimePickers copied to clipboard

Callback mechanism is bound to fail

Open rburgst opened this issue 11 years ago • 1 comments

The current design with specifying a callback object is bound to fail upon screen rotation. The proper pattern is to check whether the owning activity implements a specific interface and call that. The fact that fragments and activities are being recreated makes it impossible to store pointers to callback objects.

Try the following

  1. open the date picker and pick a date (remember it)
  2. rotate the screen
  3. press done

Expected: selected date is set Actual: the old value remains

rburgst avatar Sep 30 '13 04:09 rburgst

the alternative would be to call setOnDateSetListener after the owning fragment/activity has been recreated.

rburgst avatar Sep 30 '13 04:09 rburgst