OnDateChangedListener()类方法中使用timePicker方法,提示方法不存在是什么原因,编辑器没有报错,程序运行出错
datePicker.init(year, month - 1, day, new DatePicker.OnDateChangedListener() {
@Override
public void onDateChanged(DatePicker datePicker, int i, int i1, int i2) {
title=i + "-" + (i1 + 1) + "-" + i2 + " " + timePicker.getHour() + ":" + timePicker.getMinute();
setTitle(title);
}
});
timePicker.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() {
@Override
public void onTimeChanged(TimePicker timePicker, int i, int i1) {
title=datePicker.getYear()+"-"+datePicker.getMonth()+"-"+datePicker.getDayOfMonth()+" "+i+":"+i1;
setTitle(title);
}
});