'MaterialTimePicker does not allow user to pick seconds
I am working on a flutter project where it is required by the user that the user must have to pick the time in hours:minutes:seconds, by using showTimePicker() I am able to pick the hours and minutes but i cannot find any way to pick the seconds. any help in this regard will be very helpful.
Solution 1:[1]
Try this one,
TimePickerDialog tpd = TimePickerDialog.newInstance(
new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePickerDialog view, int hourOfDay, int minute, int second) {
//put some interesting code
}
},
now.get(Calendar.HOUR_OF_DAY),
now.get(Calendar.MINUTE),
true
);
tpd.setMinTime(10, 0, 0); // MIN: hours, minute, secconds
tpd.show(getFragmentManager(), "TimePickerDialog");
The easiest way to add the Material DateTime Picker library to your project is by adding it as a dependency to your build.gradle.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Manishyadav |
