Multiple Alarms In Android Using Android Services
<p>This is my save button in which i put alarm. But problem is if i add 1 alarm it works great but if i add an alarm next minute before last alarm has triggered it cancels last alarm and updates to new one, i tried changing request code but it isnt working for me</p>

<pre><code>        save = (Button)findViewById(R.id.save_rem);
        save.setOnClickListener(new OnClickListener() 
        {

            public void onClick(View arg0) 
            {
                title_txt = title.getText().toString();
                description_txt = description.getText().toString();
                id++;


                addRemInDb a = new addRemInDb();
                int v = a.insert(title_txt, hour, minute, mMonth, mDay, mYear, description_txt);
                //a.deleteTable();
                a.closeDB();
                if(v == -1)
                {
                    Toast.makeText(getApplication(), "Title &amp; Time Must Not Be Same",Toast.LENGTH_LONG).show();
                }
                else
                {                                               
                    Calendar cal = Calendar.getInstance();

                    //Setting alarm to be triggered on specified date and time
                    cal.set(mYear, mMonth, mDay, hour, minute, seconds);

                    requestcode++; // Here request code is adding every time when i click in save button

                    Intent alarmIntent = new Intent(getApplicationContext(), AlarmReceiver.class);

                    alarmIntent.putExtra("title", title_txt);           //This is title for notification
                    alarmIntent.putExtra("note", description_txt);      //This is Description for notification
                    alarmIntent.putExtra("rq", requestcode);

                    PendingIntent sender = PendingIntent.getService(getApplicationContext(), requestcode, alarmIntent,PendingIntent.FLAG_UPDATE_CURRENT | Intent.FILL_IN_DATA);



                    AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
                    alarmManager.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender);                       

                    finish();


                }       

            }
        });
</code></pre>

<p>This is my AlarmReciever class</p>

<pre><code>public class AlarmReceiver extends Service
{
@Override
public void onCreate() 
{

}

@Override
public void onStart(Intent intent, int startId) 
{
    super.onStart(intent, startId);     


    Bundle extras = intent.getExtras();

    String title=extras.getString("title");
    String note=extras.getString("note");
    int requestcode = extras.getInt("rq");


    NotificationManager nManger = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);

    Notification notification = new Notification(R.drawable.notify, "Reminder", System.currentTimeMillis());

    PendingIntent contentIntent = PendingIntent.getService(getApplicationContext(), requestcode, new Intent(getApplicationContext(), AlarmReceiver.class), 0);

    notification.setLatestEventInfo(getApplicationContext(), note, title, contentIntent);
    notification.flags = Notification.FLAG_INSISTENT;
    notification.defaults = Notification.DEFAULT_SOUND;

    nManger.notify(NOTIFICATION_ID, notification);

}
</code></pre>
