How to check if a service is running on Android? -


how check if background service (on android) running?

i want android activity toggles state of service -- lets me turn on if off , off if on.

i had same problem not long ago. since service local, ended using static field in service class toggle state, described hackbod here

edit (for record):

here solution proposed hackbod:

if client , server code part of same .apk , binding service concrete intent (one specifies exact service class), can have service set global variable when running client can check.

we deliberately don't have api check whether service running because, without fail, when want end race conditions in code.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -