If you call TimePickerDialog from java, you will be in clock mode, so I would like to know how to call it in spinner mode.
Calendar calendar=Calendar.getInstance();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get (Calendar.MINUTE);
TimePickerDialog timeDialog = new TimePickerDialog(this,
newTimePickerDialog.OnTimeSetListener(){
@ Override
public void onTimeSet(TimePicker timePicker, inth, intm) {
String time = String.format ("%02d hour %02d minute", h, m);
TextView end= (TextView) findViewById (R.id.endTime);
end.setText(time);
}
}, hour, minute, true);
timeDialog.show();
TimePickerDialog timeDialog = newTimePickerDialog(this,
AlertDialog.THEME_HOLO_LIGHT,
newTimePickerDialog.OnTimeSetListener(){
@ Override
public void onTimeSet(TimePicker timePicker, inth, intm) {
String time = String.format ("%02d hour %02d minute", h, m);
TextView end= (TextView) findViewById (R.id.endTime);
end.setText(time);
}
}, hour, minute, true);
timeDialog.show();
If you set the HOLO theme for the second constructor argument like this, you will become a spinner.I think it's deprecated because it's old.
619 GDB gets version error when attempting to debug with the Presense SDK (IDE)
925 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
577 Who developed the "avformat-59.dll" that comes with FFmpeg?
574 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.