You do not indicate where you are doing this work. Is it in the BroadcastReceiver or elsewhere?
On Tue, May 17, 2011 at 1:41 PM, Simon Platten <[email protected]> wrote: > I am scheduling an event with the AlarmManager: > > PendingIntent sender = PendingIntent.getBroadcast(context, 12345, intent, > PendingIntent.FLAG_UPDATE_CURRENT); > AlarmManager am = > (AlarmManager)context.getSystemService(Context.ALARM_SERVICE); > am.cancel(sender); > am.set(AlarmManager.RTC_WAKEUP, lngNextUpdate, sender); > > The only reason I call the "cancel" method is just incase the user edits the > action and needs to reschedule the event. Once the alarm has been scheduled > it runs every hour for a time, each time the > alarm expires I call: > > PowerManager pm = > (PowerManager)context.getSystemService(Context.POWER_SERVICE); > m_wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "wprotatorReciever" ); > > perform my logic and reschedule next alarm and end with: > > m_wl.release(); > > Calling the release throws an exception, even though "m_wl" is valid. The > problem is that for some reason the alarm stops re-scheduling itself after a > number of runs and I have no idea why, if I go into the application and kick > it off again it resumes without fault. > > What am I missing? > > Thank you, > Simon > > > > > > > -- > 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 -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 3.4 Available! -- 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

