I need to change default text values on timepicker
in android (java) and can't figure out how to do that.
I've found .setTitle
and .setmessage
, but when clicking on keyborad icon in Timepicker dialog:
and shows another way to change time it has another title and default message as instructions that I would like to change Second timepicker dialog output
.
I'm calling a simple TimePickerDialog
. Any suggestions? regards
You can check this out. This works for me good.
@Subscribe
public void setAlarm(OnAlarmClickEvent event) {
arrivalTime = event.arrivalTime;
alarmTime = event.arrivalTime;
int reminder = Integer.parseInt(sharedPreferences.getString(getString(R.string.pref_key_alarm_reminder), "5"));
alarmTime = alarmTime.minusMinutes(reminder);
TimePickerDialog timePickerDialog = new TimePickerDialog(
this,
this,
alarmTime.getHourOfDay(),
alarmTime.getMinuteOfHour(),
DateFormat.is24HourFormat(this)
);
timePickerDialog.setTitle(R.string.alarm_dialog_title);
timePickerDialog.setMessage(getString(R.string.alarm_dialog_message_fmt, DateUtils.formatTime(arrivalTime)));
timePickerDialog.show();
}