我在同一个活动中有两个日期选择器并且它们相互连接,因为当用户更改一个日期时,另一个日期选择器日期直接更改 这里是听众
//initialize period date picker with current date and on date change listener
periodDatePicker.init(currentYear, currentMonth, currentDay, new OnDateChangedListener()
{
@Override
public void onDateChanged(DatePicker periodDatePicker, int currentYear, int currentMonth,int currentDay) {
// TODO Auto-generated method stub
Number = 1;
birthDayDatePicker.init(currentYear, currentMonth, currentDay, null);
birthDateCalculations();
}
});
//initialize birth date picker with current date and on date change listener
birthDayDatePicker.init(currentYear, currentMonth, currentDay, new OnDateChangedListener () {
@Override
public void onDateChanged(DatePicker birthDayDatePicker, int currentYear, int currentMonth, int currentDay) {
// TODO Auto-generated method stub
Number = 2;
periodDatePicker.init(currentYear, currentMonth, currentDay, null);
periodDateCalculations();
}
});
当调用一个日期选择器侦听器时,我将另一个侦听器转到第二个日期选择器为 null ,我的问题是,我怎样才能使我转向 null 的侦听器再次处于活动状态