本文整理了Java中android.widget.TimePicker.setHour()
方法的一些代码示例,展示了TimePicker.setHour()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TimePicker.setHour()
方法的具体详情如下:
包路径:android.widget.TimePicker
类名称:TimePicker
方法名:setHour
暂无
代码示例来源:origin: ankidroid/Anki-Android
@Override
public void setTime(TimePicker picker, int hour, int minute) {
picker.setHour(hour);
picker.setMinute(minute);
}
代码示例来源:origin: SecUSo/privacy-friendly-pedometer
protected void setHour(TimePicker timePicker, int hour) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
timePicker.setHour(hour);
} else {
timePicker.setCurrentHour(hour);
}
}
代码示例来源:origin: renyuneyun/Easer
private static void setTimePicker(TimePicker timePicker, Calendar calendar) {
int hour, minute;
hour = calendar.get(Calendar.HOUR_OF_DAY);
minute = calendar.get(Calendar.MINUTE);
if (Build.VERSION.SDK_INT >= 23) {
timePicker.setHour(hour);
timePicker.setMinute(minute);
} else {
timePicker.setCurrentHour(hour);
timePicker.setCurrentMinute(minute);
}
}
代码示例来源:origin: renyuneyun/Easer
private static void setTimePicker(TimePicker timePicker, Calendar calendar) {
int hour, minute;
hour = calendar.get(Calendar.HOUR_OF_DAY);
minute = calendar.get(Calendar.MINUTE);
if (Build.VERSION.SDK_INT >= 23) {
timePicker.setHour(hour);
timePicker.setMinute(minute);
} else {
timePicker.setCurrentHour(hour);
timePicker.setCurrentMinute(minute);
}
}
代码示例来源:origin: Joysing/AlipayAutoGetForest
private void updateUI() {
int hour = mShareUtil.getInt(Config.KEY_HOUR, -1);
int minute = mShareUtil.getInt(Config.KEY_MINUTE, -1);
if (hour == -1 && minute == -1) {
// do nothing
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
timepick.setHour(hour);
timepick.setMinute(minute);
}
}
}
代码示例来源:origin: quemb/QMBForm
@SuppressWarnings("deprecation")
@Override
protected void initDatePicker(Calendar calendar) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
{
mTimePicker.setHour(calendar.get(Calendar.HOUR_OF_DAY));
mTimePicker.setMinute(calendar.get(Calendar.MINUTE));
}
else
{
mTimePicker.setCurrentHour(calendar.get(Calendar.HOUR_OF_DAY));
mTimePicker.setCurrentMinute(calendar.get(Calendar.MINUTE));
}
mTimePicker.setOnTimeChangedListener(this);
if (DateFormat.is24HourFormat(getContext()))
mTimePicker.setIs24HourView(true);
}
代码示例来源:origin: denzilferreira/aware-client
int minute = chour.get(Calendar.MINUTE);
if (Build.VERSION.SDK_INT >=23) {
timePicker.setHour(hour);
} else {
timePicker.setCurrentHour(hour);
代码示例来源:origin: stackoverflow.com
picker.setCurrentMinute(lastMinute);
} else {
picker.setHour(lastHour);
picker.setMinute(lastMinute);
代码示例来源:origin: Gwokhov/Deadline
timePicker.setIs24HourView(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
timePicker.setHour(mCalendar.get(Calendar.HOUR_OF_DAY));
timePicker.setMinute(mCalendar.get(Calendar.MINUTE));
} else {
内容来源于网络,如有侵权,请联系作者删除!