Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void startOrEditAlarm() {
- AlarmManager alarm = (AlarmManager)this.getSystemService(Context.ALARM_SERVICE);
- int update = mPrefs.getInt("update", 1);
- alarm.cancel(PendingIntent.getService(this, UPDATER_SERVICE, new Intent(this, UpdaterService.class), 0));
- if(update != Frequency.NONE.ordinal()) {
- int freq = Frequency.getTime(update);
- Log.e("freq test", "control: " + freq);
- alarm.setInexactRepeating(AlarmManager.RTC_WAKEUP, Calendar.getInstance().getTimeInMillis() + freq, freq, PendingIntent.getService(this, UPDATER_SERVICE, new Intent(this, UpdaterService.class), 0));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment