Guest User

Untitled

a guest
Dec 14th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. Calendar cal = Calendar.getInstance();
  2.  
  3. cal.setTimeInMillis(System.currentTimeMillis());
  4. cal.clear();
  5.  
  6. cal.set(Calendar.YEAR, 2017);
  7. cal.set(Calendar.MONTH, 11);
  8. cal.set(Calendar.DAY_OF_MONTH, 13);
  9. cal.set(Calendar.HOUR_OF_DAY, 11);
  10. cal.set(Calendar.MINUTE, 30);
  11. cal.set(Calendar.SECOND, 0);
  12. cal.set(Calendar.MILLISECOND, 0);
  13. cal.set(Calendar.AM_PM, Calendar.AM_PM);
  14.  
  15. AlarmManager alarmMgr = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
  16. Intent intent = new Intent(this, AlarmReceiver.class);
  17. PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, 0);
  18. alarmMgr.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pendingIntent);
Add Comment
Please, Sign In to add comment