0

Is there any way to add multiple reminders for the same event in android (I need it before 4 hours, 3 hours, 2 hours, 1 hour)) Hope you guys can help me..Thanks in advance

JI Thi
  • 13
  • 4

2 Answers2

0

you should be more specific, where do you want multiple reminders? In the callendar app?

You should take a look at this : Add event and multiple reminder to that event in calender app

how to set multiple reminders in Android

Community
  • 1
  • 1
Thomas Fenot
  • 19
  • 10
0

if you are using alarm manager then here is code

    // context variable contains your `Context`
AlarmManager mgrAlarm = (AlarmManager) context.getSystemService(ALARM_SERVICE);
ArrayList<PendingIntent> intentArray = new ArrayList<PendingIntent>();

for(i = 0; i < 10; ++i)
{
   Intent intent = new Intent(context, OnAlarmReceiver.class);
   // Loop counter `i` is used as a `requestCode`
   PendingIntent pendingIntent = PendingIntent.getBroadcast(context, i, intent, 0);
   // Single alarms in 1, 2, ..., 10 minutes (in `i` minutes)
   mgrAlarm.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, 
                SystemClock.elapsedRealtime() + 60000 * i, 
                pendingIntent); 

   intentArray.add(pendingIntent);
}
Dhara Patel
  • 359
  • 5
  • 19