2011/1/15 kl4232 <[email protected]> > Thank you for this. I accidently posted my question before I was > finished composing it. >
That's what I figured > > So having a unique action (=feature name) for the intent inside the > pending intent isn't enough. > Distinict action strings would work, but I don't see that in your code. > I did see, when I did "adb ahell dumpsys alarm" and I know I had 2 > alarms set, then there was only one RTC_WAKEUP entry for my app, and > not 2 as I would have expected. > I'll try putting in a unique request code and see if that solves the > problem. > > Thanks > > On Jan 15, 10:00 am, Kostya Vasilyev <[email protected]> wrote: > > 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 <[email protected]> > > > > > > > > > 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 > [email protected] > > > To unsubscribe from this group, send email to > > > [email protected]<android-developers%[email protected]> > <android-developers%2BunsubsĀ[email protected]> > > > For more options, visit this group at > > >http://groups.google.com/group/android-developers?hl=en- Hide quoted > text - > > > > - Show quoted text - > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<android-developers%[email protected]> > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

