Jeffrey Blattman wrote:
> i want to schedule a repeating task. i start my app, and register with
> alarm manager (repeating). all is fine, as long as my app is in memory.
> if i for example press back to remove my app from the stack, i no longer
> receive alarms. same thing if i manually kill the app.
> 
> is this correct? my understanding is that once the alarm is scheduled,
> it repeats regardless of the state of the app.

You could encounter that behavior if you registered your
BroadcastReceiver via Java, instead of via the manifest.

Here is some sample code from one of my books that demonstrates the use
of AlarmManager and putting the alarm's BroadcastReceiver in the manifest:

http://github.com/commonsguy/cw-advandroid/tree/master/SystemServices/Alarm

That example is somewhat more elaborate, as it demonstrates WakeLock
management and delegating long-running work to an IntentService,
capabilities your app may or may not need.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Looking for Android opportunities? http://wiki.andmob.org/hado

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to