-3

I tried to create multiple alarms at different times in Android. And I googled for it. But I can't understand how can we create? Can anybody share?

I want to create alaram at 8am, 1pm, 7pm.

So, how can I create like this. Please help me.

NorthCat
  • 8,315
  • 16
  • 40
  • 45
Siva Polam
  • 79
  • 1
  • 12

3 Answers3

2

You can use alarmManager.setRepeating() method with different request codes which will avoid overwriting the alarms. if you do not want repeating alarm then try to set interval value to 0.

You can check this link for more info and If you need the code example then follow this link

Community
  • 1
  • 1
1

You need to use the Alarm Manager. And for different alarms you need to give each alarm an Unique id. Here is the helpful link over the stackoverflow. try this and let me know.And here is the source code.

Community
  • 1
  • 1
ghost talker
  • 384
  • 4
  • 14
0

Use void set (int type, long triggerAtMillis, PendingIntent operation) in AlarmManager.

mianlaoshu
  • 1,550
  • 3
  • 17
  • 37