Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. How_Many_Day = 1;
  2. Total_Day = How_Many_Day * 24*60*60*1000;
  3. Intent myIntent = new Intent(AndroidAlarmService.this, MyAlarmService.class);
  4. pendingIntent = PendingIntent.getService(AndroidAlarmService.this, 0, myIntent, 0);
  5. AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
  6. Calendar timeOff9 = Calendar.getInstance();
  7. timeOff9.set(Calendar.HOUR_OF_DAY, 4);
  8. timeOff9.set(Calendar.MINUTE, 25);
  9. timeOff9.set(Calendar.SECOND, 0);
  10. alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, timeOff9.getTimeInMillis(), Total_Day, pendingIntent);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement