If your code is set up along the lines of the Wikipedia sample widget (which it seems to be), and the widget's onUpdate invokes the service with startService, then everything should be fine already. StartService will, obviously, start the service as necessary.
If there are still problems updating the widget, ask your user to add your service to the task killer's exclude list. Better yet, try to educate the user about the evil nature of task killers, perhaps he/she will stop using them altogether. -- Kostya Vasilyev -- http://kmansoft.wordpress.com 31.08.2010 22:14 пользователь "Alex" <maroeb...@gmail.com> написал: What is the correct way to ensure that a widget update service is restarted if it has been killed? In my widget, I start the service in the onUpdate event, but if the widget and service are killed (by a task killer, for example), the widget restarts, but the service doesn't. On Aug 31, 6:01 pm, Kostya Vasilyev <kmans...@gmail.com> wrote: > A Service can still get killed ... > http://developer.android.com/reference/android/app/Service.html#Proce... > > -- Kostya > > 31.08.2010 20:48, Agus пишет: > > > > > A thread hosted by the ApplicationContext ... > > On Tue, Aug 31, 2010 at 9:22 AM, Kostya Vasilyev<kmans...@gmail.com> wrote: > >> The difference is that Activity lifecycle is managed by the user, and > >> Service lifecycle ... -- You received this message because you are subscribed to the Google Groups "Android Developers" group... -- 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