android set multiple alarms simultaneously?
<p>I have two alarm manager services.</p>

<ol>
<li>First Alarm service is run after every 2 mins.</li>
<li>Second alarm service is run every day.</li>
</ol>

<p>My problem is that when first alarm service is complete it set the second alarm service and first alarm manager goes to the pending intent when ever second alarm service complete after a day it again run the first service.</p>

<p>Is there any way to run both service simultaneously?</p>

<p><strong>First Alarm manager service code is</strong> : <strong>that is run after 2mins.</strong></p>

<pre><code>public static void setAlarm(Context c, int seconds) {
    AlarmManager mgr = (AlarmManager) c.getSystemService(Context.ALARM_SERVICE);
    Intent intent = new Intent(c, MyAlarmService.class);
    //PendingIntent pi = PendingIntent.getService(c, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
    PendingIntent pi = PendingIntent.getBroadcast(c, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT);
    mgr.setInexactRepeating(AlarmManager.RTC_WAKEUP, SystemClock.elapsedRealtime(), seconds * 1000, pi);
}
</code></pre>

<p><strong>The second alarm manager service code is : that is run once in a day</strong> </p>

<pre><code>public static void setAlarm(Context c, int seconds) {
    AlarmManager mgr = (AlarmManager) c.getSystemService(Context.ALARM_SERVICE);
    Intent intent = new Intent(c, MyAlarmService.class);
    //PendingIntent pi = PendingIntent.getService(c, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
    PendingIntent pi = PendingIntent.getBroadcast(c, 2, intent, PendingIntent.FLAG_UPDATE_CURRENT);
    mgr.setInexactRepeating(AlarmManager.RTC_WAKEUP, SystemClock.elapsedRealtime(), seconds * 1000, pi);
}
</code></pre>

<p><strong>and both alarm managed from same activity.</strong></p>
