控件 -- TimePickerDialog

使用

int mHourOfDay, mMinute;
private void testTimePickerDialog() {
    Calendar c = Calendar.getInstance();
    mHourOfDay = c.get(Calendar.HOUR_OF_DAY);
    mMinute = c.get(Calendar.MINUTE);
    new TimePickerDialog(this, new TimePickerDialog.OnTimeSetListener() {

        @Override
        public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
            mHourOfDay = hourOfDay;
            mMinute = minute;
        }
    }, mHourOfDay, mMinute, true).show();
}

你可能感兴趣的:(控件 -- TimePickerDialog)