In Android Alarm Manager, how can we schedule multiple alarms which are non-repeating and do not have fixed intervals to repeat? I cannot use \'setRepeating\' function as th
As suggested @Jonathon Horsman, make sure that the intents you're creating are unique.
If you want to set 10 alarms for example :
for(int i=; i<10; i++) {
Intent intent = new Intent(YourActivity.this,
YourAlarm.class);
intent.setData(Uri.parse("timer:" + i);
PendingIntent sender = PendingIntent.getBroadcast(
YourActivity.this, 0, intent,
Intent.FLAG_GRANT_READ_URI_PERMISSION);
AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP, yourTimeInMillis, sender);
}
Worked fine for me.