Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Intent toastIntent= new Intent(getApplicationContext(),ToastBroadcastReceiver.class);
- PendingIntent toastAlarmIntent = PendingIntent.getBroadcast(getApplicationContext(), 0, toastIntent,PendingIntent.FLAG_UPDATE_CURRENT);
- long startTime=System.currentTimeMillis(); //alarm starts immediately
- AlarmManager backupAlarmMgr=(AlarmManager)this.getSystemService(Context.ALARM_SERVICE);
- backupAlarmMgr.setInexactRepeating(AlarmManager.RTC_WAKEUP,startTime,AlarmManager.INTERVAL_FIFTEEN_MINUTES,toastAlarmIntent); // alarm will repeat after every 15 minutes
Add Comment
Please, Sign In to add comment