Only one alarm fired when multiple ones are set

My goal is to fire an alarm for every event from eventsDb.getFavouriteEvents() but only one is fired everytime.

In my opinion, it may be caused by setting PendingIntent.FLAG_UPDATE_CURRENT, however I need this flag to post Extras with an intent. Is there any way not to set this flag and still post Extras with the intent?

I'm storing PendinIntents in a Collection (pendingIntents) because I'm canceling them in onDestroy() of this Service class.

This is code from onCreate():

for(Event event : eventsDB.getFavouriteEvents()) { Intent intent = new Intent(AlarmReciever.ONCOMING_EVENT); intent.putExtra(Event.TITLE, event.getTitle()); PendingIntent pendingIntent = PendingIntent.getBroadcast(EventAlarmService.this, 0, intent, Intent.FLAG_GRANT_READ_URI_PERMISSION | PendingIntent.FLAG_UPDATE_CURRENT); alarmManager.set(AlarmManager.RTC_WAKEUP, event.getTime(), pendingIntent); pendingIntents.add(pendingIntent); }

Thanks for help!

-------------Problems Reply------------

The PendingIntent will be overwritten on send if they share the same code. Changing the code for each intent on send should correct this problem.

Category:android Views:0 Time:2012-05-02

Related post

  • How to place a kill safe alarm fired on daily basis? 2010-06-03

    I know how to setup an alarm to fire repeatedly, but the alarm stops firing after my application is killed. How do I make sure the alarm continues to fire as it was setup? --------------Solutions------------- You can automatically restart your closed

  • Android Button OnClick event fired after multiple clicks 2010-06-30

    I have a custom Android (1.5) Title bar which includes a button. Using the custom title bar in Activity A, I am able to click the button, and have the OnClickListener event fire as expected. However, when I launch Activity B for result, from Activity

  • set the time in Alarm manager Android - alarm fired instantly 2010-10-23

    Possible Duplicate: Why is my android alarm manager firing instantly? I have this code which will call alarm notification public static Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(System.currentTimeMillis()); cal.add(Calendar.HOUR_OF_D

  • Making an Alarm Clock with multiple alarm times 2010-11-19

    I am trying to make a programmable alarm clock. It should output a melody (.wav) at different moments of time. I used a usercontrol to make a digital clock. I have a timer for showing a progressbar to every second and a button that starts the process

  • Alarm Manager - Scheduling multiple Non-repeating events 2011-07-11

    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. I have the alarm times stored in Sql

  • AS3 button firing off multiple times if clicked fast only 2011-09-11

    ok so, i wrote this code: import; import flash.display.MovieClip; import flash.display.Loader; import; import; import flash.display.Stage; stop(); var loader:Loader = new Loader(); var d

  • Correct way to merge observable sequences for events fired from multiple instances 2012-01-23

    Say I have a factory method that churns out instances of type T, and I want an Rx observable sequence for events fired from all my instances originating out of the factory method. Is using Merge() as I have done below the correct and optimal way to a

  • C# onClick Event on ASP.NET Button not initially fired but postsbacks- and eventually fired after multiple clicks 2011-11-22

    I'm having a weird issue and i'm not sure where to look or how to debug. I have a Parent Page A which has a Combo box control with 7 provinces; Each Province has a User Control ( View ). By default , the selected index is province "SK" which loads in

  • JavaScript global timer fired by multiple elements? 2012-02-23

    I have two jQuery sliders on a page. I would like to fire an event when the user has set both of them. I define "set" as "when both sliders have been idle for 3 seconds". Can I do something like this, or is it bad practice to create a global variable

  • android cancel multiple alarms with custom uri 2011-03-27

    I created some alarms in my service which service sometimes restarts. I would like to cancel these alarms when my service restarts. I set multiple alarms with multiple action type and with custom URIs like this (I need custom URIs for multiple alarms

  • Prevent events from firing multiple times from single action 2009-07-02

    How can I prevent the firing of multiple events of the same kind triggered by a single action? For example, I have a ListView containing some items. When I select or deselect all items, the SelectedIndexChanged event is fired once for each item. Rath

  • Alarm Manager setRepeating firing randomly 2014-08-15

    I've read through most of the posts here about setRepeating alarms, and none seem to fix my issue. I have two repeating alarms set for a set amount of times as seen here: trigger = System.currentTimeMillis() + (Integer.parseInt(test) * 60 * 1000); wo

  • WM6 Multiple Alarms and can't Dismiss Alarms 2015-02-21

    I am having a lot of hassle with Alarms on my WM6 Vodafone V1415. My phone now bleeps at multiple time throughout the day, according to previous alarm times I have set. But I have no way of turning the alarms off, and only one alarm appears in the Se

  • Display alertDialog on alarm? 2011-07-17

    I would like to display an alert dialog when the alarm goes off. Here is where i am so far. Im not sure if im doing it right. } @Override void doTaskWork(Intent intent){ String taskId = intent.getStringExtra(TaskHelper._id); NotificationManager mgr =

  • How to test for multiple row actions in a SQL Server trigger? 2009-01-02

    My kindergarten SQL Server taught me that a trigger may be fired with multiple rows in the inserted and deleted pseudo tables. I mostly write my trigger code with this in mind, often resulting in some cursor based cludge. Now I'm really only able to

  • application_start firing unexpectedly 2009-02-12

    Hi I am looking at an application that makes calls to a database within the application start inside global.asax. These calls takes around 3 seconds (depends on SQL cache plan) to run. I have noticed that the application runs slowly when I fi

  • Firing click event from code in gwt 2009-08-06

    I have created a custom widget in gwt which extends the composite.I am using focus panel in that.For FocusPanel I added ClickHandler.Then I have added keyboard listner.Now on press of Enter key it should trigger click event.Can any one help me to tri

  • Updating weather info, should I use alarm and/or a service? 2010-06-06

    I am having some design techniques about How shall I schedule a code to retrieve the weather info? Should I use alarms to retrieve the weather each 10 minutes? And do I need to run a service for this? Or just put the code in the Broadcastreceiver and

  • set More Alarm in Android? 2011-01-31

    I use the following code to create alarm. String strDateTime=strDate+" "+strTime; DateFormat dfm = new SimpleDateFormat("yyyy-MM-dd HH:mm"); Date alarmTime = null; try { alarmTime = dfm.parse(strDateTime); } catch (ParseException e) { // TODO Auto-ge

Copyright (C), All Rights Reserved.

processed in 0.115 (s). 11 q(s)