[android-developers] Cancelling and Alarm

2011-06-14 Thread Simon Platten
When I update an alarm I call the alarm manager cancel method before setting it up...However this doesn't always cancel the old alarm and sometimes I seem to get more than one alarm scheduled at different rates. In my activity I let the user change the alarm time interval, this is then applied to

Re: [android-developers] Cancelling and Alarm

2011-06-14 Thread Kostya Vasilyev
The parameters are definitely used. The second one uniquely identifies the pending intent. The fourth one controls what happens when there is / is not an existing pending intent just like the one being created. Canceling the old pending intent before setting a new alarm is not necessary, the

Re: [android-developers] Cancelling and Alarm

2011-06-14 Thread Mark Murphy
On Tue, Jun 14, 2011 at 3:16 PM, Simon Platten simonaplat...@googlemail.com wrote: In my activity I let the user change the alarm time interval, this is then applied to the alarm manager, but if I set one alarm running at 1000 ms, then cancel it and set again to be 6ms, the previous alarm

Re: [android-developers] Cancelling and Alarm

2011-06-14 Thread Mark Murphy
On Tue, Jun 14, 2011 at 3:23 PM, Mark Murphy mmur...@commonsware.com wrote: On Tue, Jun 14, 2011 at 3:16 PM, Simon Platten simonaplat...@googlemail.com wrote: In my activity I let the user change the alarm time interval, this is then applied to the alarm manager, but if I set one alarm running

Re: [android-developers] Cancelling and Alarm

2011-06-14 Thread Simon Platten
Hi Mark, The application schedules wall-paper changes, originally I was using Timers, but this meant the application had to be resident all the time, now I'm using the AlarmManager to schedule rotations, I've limited the maximum rotation to 1 second, although in reality I wouldn't expect

Re: [android-developers] Cancelling and Alarm

2011-06-14 Thread Mark Murphy
On Tue, Jun 14, 2011 at 3:34 PM, Simon Platten simonaplat...@googlemail.com wrote: The application schedules wall-paper changes, originally I was using Timers, but this meant the application had to be resident all the time, now I'm using the AlarmManager to schedule rotations, I've limited the

Re: [android-developers] Cancelling and Alarm

2011-06-14 Thread Simon Platten
Ty Mark, I'll try it! On 14/06/2011 8:37 PM, Mark Murphy wrote: On Tue, Jun 14, 2011 at 3:34 PM, Simon Platten simonaplat...@googlemail.com wrote: The application schedules wall-paper changes, originally I was using Timers, but this meant the application had to be resident all the time, now