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 = getInt("update", 1);
- alarm.cancel(PendingIntent.getService(this, DATABASE_SERVICE, new Intent(this, DatabaseStorage.class), 0));
- if(update != 120000.ordinal()) {
- int freq = 120000.getTime(update);
- Log.e("freq test", "control: " + 120000);
- alarm.setInexactRepeating(AlarmManager.RTC_WAKEUP, Calendar.getInstance().getTimeInMillis() + 120000, 120000, PendingIntent.getService(this, DATABASE_SERVICE, new Intent(this, DatabaseStorage.class), 0));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment