Services will be occasionally killed in the background if they aren't set to
be foreground.  This is all normal behavior.  You control what happens when
they restart (if they restart at all) through what you return from
onStartCommand().  It looks like you are not explicitly returning anything,
and haven't set your target SDK version to be >= the 2.0 level, so you are
getting the old behavior.

More discussion is here:
http://android-developers.blogspot.com/2010/02/service-api-changes-starting-with.html

On Wed, Jan 12, 2011 at 8:31 PM, Jake Basile <[email protected]> wrote:

> I did some log searching, and found that this happens before the service
> stops working:
> 01-12 23:26:14.268: INFO/ActivityManager(109): No longer want
> com.jakebasile.android.hearingsaver (pid 31188): hidden #16
> 01-12 23:26:14.287: WARN/ActivityManager(109): Scheduling restart of
> crashed service com.jakebasile.android.hearingsaver/.RegistrationService in
> 5000ms
> 01-12 23:26:18.068: DEBUG/dalvikvm(496): GC_EXPLICIT freed 23K, 55% free
> 3445K/7559K, external 1625K/2137K, paused 69ms
> 01-12 23:26:19.322: INFO/ActivityManager(109): Start proc
> com.jakebasile.android.hearingsaver for service
> com.jakebasile.android.hearingsaver/.RegistrationService: pid=31563
> uid=10064 gids={}
>
> But afterwards, the service no longer works correctly. My onStartCommand
> isn't called, so the receiver doesn't get re-registered.
>
> I don't understand why it would be a "crashed service". There is no error
> info being printed, and my code doesn't really *do* anything to cause a
> crash. Any ideas?
>
> --
> 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
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

Reply via email to