0
我正在使用this问题的代码(第一个答案)在一个对话框中选择日期和时间。不过,我正在做一个开始时间和结束时间,所以有两个按钮可以打开同一个对话框界面。有没有办法找出哪一个打开的对话框界面,使我的onSet
方法我可以这样做:有没有办法告诉哪个按钮打开了一个对话框界面?
if (start_button opened the dialog) { return result to start time TextView; } else if (end_button opened the dialog) { return result to end time TextView; }
怎么样一个布尔标志设置为true无论选择哪个按钮,您都可以在条件中检查该标志以确定选择了哪个按钮。当然必要时保持国旗。 – Ryan