You need to do it in your manifest, since at the point where
boot_completed is sent none of your app code can possibly have run to
register a listener.

Be aware that boot_completed is a point where the system is under
heavy load/contention - be sure to keep your onReceive function as
short as it can possibly be (specifically, avoid I/O if at all
possible).

JBQ

On Fri, Feb 27, 2009 at 7:40 AM, Graeme <graeme.br...@btinternet.com> wrote:
>
> Hi
>
> I have written a Service component within an application .apk.
> I want the Service to receive the ACTION_BOOT_COMPLETE
> Intent which I understand is broadcast when the android system has
> finished booting.
>
> I am unclear as to whether I need to declare the BroadcastReceiver
> statically within the AndroidManifest.xml file for the application
> package
> via a <receiver> tag or whether I need to create it dynamically and
> call Context.registerReceiver() etc. within my Service code.
>
> Can anyone offer any advice, please?
>
> Thanks
> Graeme
> >
>



-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Please don't contact me directly.

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

Reply via email to