我希望我的TimePickerDialog默认设置为19.00。我怎么能得到这个?
public void ora(View v) {
Calendar calendar = Calendar.getInstance();
myDialog = new TimePickerDialog(Promemoria_giornaliero.this, new OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
txtTime.setText(hourOfDay + ":" + minute);
}
}, calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), true);
myDialog.show();
};
答案 0 :(得分:1)
您目前正在提供calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE)
作为默认的小时和分钟。将其替换为19, 0
。