问题
I have a function for time picker dialog as follows:
private fun showStartingTimeDialog() {
val hr = 9
val mn = 0
val startingTimeListener = TimePickerDialog.OnTimeSetListener { _, _, _ -> /* no time setting */ }
TimePickerDialog(this, startingTimeListener, hr, mn, false).show()
}
I want to restrict the selection between 8am and 10am, meaning that the user can only slide the hand of clock between this range, how to do that?
来源:https://stackoverflow.com/questions/56526133/how-to-set-range-of-time-picker-dialog-in-android-in-kotlin