Android Question Check if service is running

Discussion in 'Android Questions' started by kohle, Apr 14, 2015.

  1. kohle

    kohle Active Member Licensed User

    How I can check if a service is running ?

    I start a service with StartService(...) in the activity create event (firsttime)

    On the activity I have a button to turn on/off the service.
    When I turn off the service and click on the home screen button
    and do other stuff, later I bring the activity again to foreground than I want to check in the
    acitivty resume event, if the service is started or not.
    If not, I want to turn the service on again.
     
  2. NJDude

    NJDude Expert Licensed User

    lemonisdead likes this.
  3. kohle

    kohle Active Member Licensed User

    cool, thanks
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice