Hi there, some weeks ago I ask you about service life cycle and about the START_STICKY flag returned from onStartCommand(), for allowing the service to be restarted after it has been killed by the system. This way works fine on Android 2.1 and 2.2 but not in Android 2.3 (Gingerbread)... the system never calls onStartCommand() after the service has been killed. here: https://groups.google.com/group/android-developers/browse_thread/thread/b5c4aaa0ff1a609a/429fe6ab69ab72d2?hl=it#429fe6ab69ab72d2
I found a topic about this and it confirm it is a gingerbread bug. here: https://groups.google.com/group/android-developers/browse_thread/thread/d87fb390c13d141d/063e74b9e1e98f9a?hl=it&lnk=gst&q=Gingerbread+BroadcastReceiver+Issue# As a workaround I try to set the service as visible with startForeground(). Anyway I guess that this flag can't guarantee my service is always running for a long time, isn't it? Because after a long time my service has been killed again and it isn't restarted anymore. Maybe it is my fault... when I call startForeground an ongoing notification is set until I call stopForeground. While the service is running I set new ongoing notifications overriding that one has been passed from startForeground. Can this break the service foreground state? Sorry if my english isn't perfect, I hope it's clear anyway what I want to tell you. If you have any questions, please ask me. Thanks Paolo -- 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