开发者

alternative to the missing setOnDateChangeListener()-function

开发者 https://www.devze.com 2022-12-26 15:51 出处:网络
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, b

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 ini开发者_高级运维t()-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,


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号