views:

17

answers:

1

I have a DatePicker-view as well as a TimePicker-view in my layout, and everytime the date or time is changed I want to update a value. On the TimePicker I can simply set a setOnTimeChangedListener, but nothing corresponding exists for the DatePicker. A listener called OnDateChangedListener can be set in the init()-function, but it does not trigger each time the date is changed. Is there a corresponding listener, or is there a hack available to solve this problem in a satisfactory manner?

http://developer.android.com/intl/de/reference/android/widget/DatePicker.html http://developer.android.com/intl/de/reference/android/widget/TimePicker.html

Cheers,

+3  A: 

A listener called OnDateChangedListener can be set in the init()-function, but it does not trigger each time the date is changed.

According to the source code, it is called each time the date is changed. So, try that again.

CommonsWare
damnit, it was a stupid bug in my code. Atleast your answer convinced me the fault wasn't in the android API, making me find my bug. Thanks!
sandis