Guest User

Untitled

a guest
Mar 3rd, 2012
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1.     private void startOrEditAlarm() {
  2.         AlarmManager alarm = (AlarmManager)this.getSystemService(Context.ALARM_SERVICE);
  3.         int update = getInt("update", 1);
  4.         alarm.cancel(PendingIntent.getService(this, DATABASE_SERVICE, new Intent(this, DatabaseStorage.class), 0));
  5.         if(update != 120000.ordinal()) {
  6.             int freq = 120000.getTime(update);
  7.             Log.e("freq test", "control: " + 120000);
  8.             alarm.setInexactRepeating(AlarmManager.RTC_WAKEUP, Calendar.getInstance().getTimeInMillis() + 120000, 120000, PendingIntent.getService(this, DATABASE_SERVICE, new Intent(this, DatabaseStorage.class), 0));
  9.         }
  10.     }
Advertisement
Add Comment
Please, Sign In to add comment