Basically, the more I think about it, unless I am missing something, I came to the conclusion that non-exact repeating alarams cannot be made to work reliably. They are fine for cases when you need to do somtheing somewhat frequently, like every hour, but for a long period repeat you have no way of knowing when to start the alarm. You MUST start the alarm when the app starts, so it can recover from Force Closes or for whatever reason the system decides to terminate it, but once you do that, you can get yourself into a cycle where you end up never firing the alarm if its period is long enough.
I changed my app to use one-shot timers, and it seems to work for all cases I can think of, but I hate to lose the power saving feature of the inexact alarm. (Unless passing 0 as the interal for setInexactRepeating() would stop it from repeating, but that's not documented so.) On Apr 22, 1:47 pm, Zsolt Vasvari <[email protected]> wrote: > > Store a SharedPreference value that indicates the time you last set the > > alarm for, defaulting to 0. > > How would that work? > > If the alarm is killed by the system for whatever reason, how would > the preference let me know if I need to restart the alarm or not? > > I think the only way to do this reliably is NOT to use repeating > alarms, but just to use one-shot alarms. -- 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

