public void onTimeSet(TimePicker view, int hourOfDay, int minute) { // onTimeSet is called when the user clicks "Set" mTimePickerCancelled = false; mHour = hourOfDay; mMinutes = minute; updateTime(); // If the time has been changed, enable the alarm. mEnabledPref.setChecked(true); // Save the alarm and pop a toast. popAlarmSetToast(this, saveAlarmAndEnableRevert()); }
private void updatePrefs(Alarm alarm) { mId = alarm.id; mEnabledPref.setChecked(alarm.enabled); mLabel.setText(alarm.label); mLabel.setSummary(alarm.label); mHour = alarm.hour; mMinutes = alarm.minutes; mRepeatPref.setDaysOfWeek(alarm.daysOfWeek); mVibratePref.setChecked(alarm.vibrate); // Give the alert uri to the preference. mAlarmPref.setAlert(alarm.alert); updateTime(); }