Alarms are keyed on PendingIntents, there can be only one for a given
pending intent. This is so you can update settings for an already-set alarm.

There are rules for when PendingIntents are considered the same intent, or
different ones. Using the same Java object certainly means it's the same
intent though.

What you can do is use a request code with PendingIntent.getBroadcast that's
unique for each alarm you want to set - three alarms, three request codes,
three unique PendingIntents.

-- Kostya

2011/1/15 kl4232 <klavin4...@yahoo.com>

> I have an app which I want to have 3 wake-up alarms to schedule 3
> features of the app.
> They are all set the same way.....
>
> m_intentName = "com.mypackage."+ FeatureName;
> m_alarmIntent = new Intent(m_intentName);
> m_alarmPendingIntent = PendingIntent.getBroadcast(this, 0,
> m_alarmIntent, 0);
>
> When I want to set the alarm I do this...
>  m_alarmMgr.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() +
> nMinutes * 60 * 1000, m_alarmPendingIntent);
>
> Then in my broadcast receiver...
> public class FeatureReceiver extends BroadcastReceiver {
> public void onReceive(Context context, Intent intent) {
>                        if (intent.getAction().compareTo(m_intentName) == 0)
> {
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to