请帮我处理我的代码。我收到这样的错误
error: no suitable constructor found for TimePickerDialog(MyHttpPostProjectActivity,<anonymous OnTimeSetListener>,int,int)
constructor TimePickerDialog.TimePickerDialog(Context,int,OnTimeSetListener,int,int,boolean) is not applicable
(actual and formal argument lists differ in length)
constructor TimePickerDialog.TimePickerDialog(Context,OnTimeSetListener,int,int,boolean) is not applicable
(actual and formal argument lists differ in length)
startTimePicker = new TimePickerDialog(this, new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
startTimeField.setText(selectedHour + ":" + selectedMinute);
}
}, hour, minute);
startTimePicker.show();
答案 0 :(得分:0)
再输入一个参数为false
startTimePicker = new TimePickerDialog(this, new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
startTimeField.setText(selectedHour + ":" + selectedMinute);
}
}, hour, minute, false);
startTimePicker.show();