GoogleDateTimePickers
GoogleDateTimePickers copied to clipboard
Callback mechanism is bound to fail
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
- open the date picker and pick a date (remember it)
- rotate the screen
- press done
Expected: selected date is set Actual: the old value remains
the alternative would be to call setOnDateSetListener after the owning fragment/activity has been recreated.