Copy Code code as follows:
New Timepickerdialog (Mainactivity.this, New Timepickerdialog.ontimesetlistener () {
@Override
public void Ontimeset (timepicker view, int hourofday, int minute) {
C.settimeinmillis (System.currenttimemillis ());
C.set (Calendar.hour_of_day, hourofday);//When setting up a pop-up dialog box
C.set (Calendar.minute, MINUTE); To set the score for a pop-up dialog box
C.set (Calendar.second, 0); Set to 0
C.set (Calendar.millisecond, 0); Set to 0
}
}
}, minute, minute, true). Show ();
The Timepickerdialog method has five parameters, the first parameter (mainactivity.this) is the activity pointer for the pop-up Time dialog box, and the second argument we end with the third argument (hour) and the fourth argument (minute) The hours and minutes for the initial display of the pop-up Time dialog box, the fifth parameter displays the parameter for set 24 o'clock, and true represents the time at 24 o'clock.