Reputation: 8818
I want to set notification for an event which will repeat every day. So the notification should come everyday at event time. How to set any notification in NotificationManager so that it repeats after certain period of time.
Upvotes: 0
Views: 1277
Reputation: 6686
If you are using AlarmManager class, it's more easier that to setup a service.
alarmManager class has a setRepeating method that repeats your alarm call at given interval after given time.
Like..
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
Intent AlarmIntent = new Intent(CONTEXT, RECEIVERCLASS.class);
ID,AlarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,YOURCALENDAR.getTimeInMillis(), AlarmManager.INTERVAL_DAY, Sender);
In the setRepeating argument, you can set the YOURCALENDAR member to the time you want......
Upvotes: 2
Reputation: 970
for this u have 2 made one service class that notify your event. when any event occurs just call start notification on event. if u not get proper idea that comment on this ans. i'll explain in detail.
Upvotes: 0