On Tue, Apr 26, 2011 at 12:46 AM, Samuel Anandaraj.J <[email protected]> wrote: > i guess you can register an activity to get notification when boot > completes, this will require permission in the manifest. so you can start > your service from this registered activity.
No. The only thing that can receive the BOOT_COMPLETED broadcast is a BroadcastReceiver. If you want an activity to start up at boot time, make it a home screen. The OP indicated that the service-at-boot-time code already existed in the project. In case I am mistaken, here is a sample of getting control at boot time: https://github.com/commonsguy/cw-advandroid/tree/master/SystemEvents/OnBoot Note that 99.9% of Android applications should not be starting a service at boot time. This is indicative of the "everlasting service" anti-pattern, which users have repeatedly and violently opposed. Please use AlarmManager and have the service run periodically, then shut down. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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

