title: Alarm Manager - Scheduling multiple Non-repeating events
body: <p>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 the alarms don't have any repeating pattern.</p>
  
  <p>I have the alarm times stored in Sqlite database table and the activity should pick the date and time from this table and set the alarms.</p>
  
  <p>If we setup different alarms in a loop, then it retains only the last one.
  I read from the post: <a href="https://stackoverflow.com/questions/6621033/how-can-create-more-than-one-alarm">How can create more than one alarm?</a></p>
  
  <p>It tells to attach the unique Id to the intent and then setting up individual alarm events. But it didn't work for me. </p>
  
  <p>Is there something we need to add in Manifest file to take care of this unique id?</p>
  
  <p>The code in the activity 'RegularSchedule' is and it creates only one alarm event:</p>
  
  <pre><code>        while (notifCursor.moveToNext()) {
              Intent intent = new Intent(RegularSchedule.this,
                      RepeatingAlarm.class);
  
              // The cursor returns first column as unique ID             
              intent.setData(Uri.parse("timer:" + notifCursor.getInt(0)));
  
              PendingIntent sender = PendingIntent.getBroadcast(
                      RegularSchedule.this, 0, intent, 0);
  
              // Setting time in milliseconds taken from database table 
              cal.setTimeInMillis(notifCursor.getLong(1));
  
              AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
              am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender);
          }
  </code></pre>
  
  <p>Please let me know if further details or code snippets are required.</p>
  
  <p>Manifest file (here RepeatingAlarm extends BroadcastReceiver):</p>
  
  <pre><code>    &lt;receiver android:name=".user_alerts.RepeatingAlarm" android:process=":remote" /&gt;
  
      &lt;activity android:name=".user_alerts.RegularSchedule"
          android:label="@string/reg_schedule_title" android:theme="@android:style/Theme.Light"&gt;
      &lt;/activity&gt;
  </code></pre>
  
  <p>RepeatingAlarm:</p>
  
  <pre><code>public class RepeatingAlarm extends BroadcastReceiver {
  @Override
  public void onReceive(Context context, Intent intent) {
      NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
  .......
      // The PendingIntent to launch our activity if the user selects this notification
      Intent notificationIntent = new Intent (context, DisplayReminder.class);
      PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
  
      // Set the info for the views that show in the notification panel.
      notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
      notification.defaults |= Notification.DEFAULT_SOUND;
      notification.defaults |= Notification.DEFAULT_VIBRATE;
      notification.defaults |= Notification.DEFAULT_LIGHTS;
  
      mNotificationManager.notify(2425, notification);
  </code></pre>