Multiple Alarms not working

  • Replies:0
  • OpenNot stickiedUnanswered
  • Forum posts: 1

Mar 18, 2015 7:16:49 PM via Website

Hi guys . this is code for multiple ALARMS but its not working.
Thanx in advance

Intent intentAlarm = new Intent(MainActivity.this,AlarmReceiver.class);
final int _id = (int) System.currentTimeMillis();

   PendingIntent intent = PendingIntent.getBroadcast(this, _id, intentAlarm, PendingIntent.FLAG_UPDATE_CURRENT);

//r3 is value entered by use in milliseconds (for example if users enters 15000 then alarm should fire after 15 seconds)

long r4=r3+new GregorianCalendar().getTimeInMillis();
AlarmManager alarmManager=(AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC_WAKEUP,r4, intent);