Android Development Tutorial Time dialog box Core code _android

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.