use of com.health.openscale.core.alarm.AlarmHandler in project openScale by oliexdev.
the class ReminderPreferences method updateAlarmPreferences.
private void updateAlarmPreferences() {
ComponentName receiver = new ComponentName(getActivity().getApplicationContext(), ReminderBootReceiver.class);
PackageManager pm = getActivity().getApplicationContext().getPackageManager();
AlarmHandler alarmHandler = new AlarmHandler();
if (reminderEnable.isChecked()) {
alarmHandler.scheduleAlarms(getActivity());
pm.setComponentEnabledSetting(receiver, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
} else {
alarmHandler.disableAllAlarms(getActivity());
pm.setComponentEnabledSetting(receiver, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
}
}
Aggregations