如何识别OnTimeSetListener方法内部调用的TimePickerDialog?
我有两个不同的 TimePickerDialogs 共享相同的回调方法,我试图找出如何区分它们。目前,他们唯一的不同之处在于他们的头衔,尽管这可能会改变。
无论如何,如果仅给出传递到 TimePickerDialog.OnTimeSetListener 方法的 TimePicker,如何获取 TimePickerDialog 的标题?
多谢。
I have two different TimePickerDialogs that share the same callback method, and I'm trying to figure out how to differentiate between them. Currently the only way they differ is in their title, although that can change.
Anyways, how do I get the TimePickerDialog's title, given only the TimePicker that's passed into the TimePickerDialog.OnTimeSetListener method?
Thanks a lot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在打开对话框之前,只需将当前使用的 TimePickerDialog 存储在某个类变量中即可。当您的回调被调用时,请引用该变量来区分这两个对象
Just store the currently used TimePickerDialog in some class variable before you open the dialog. When your callback is called refer to that variable to distinguish between those two objects