Android Question Service swipe out of app tray

Discussion in 'Android Questions' started by jayel, Jun 22, 2015.

  1. jayel

    jayel Active Member Licensed User

    Hello,

    I have an app that runs a service with a websocket.
    Now when I push the button that shows all the apps that are running, i swipe out my app and the pauze event fires with userclosed true, there I close my service.(normal)

    When i push the home button the pauze event fires with userclosed = false (normal)

    But when I push the button to show all my running apps and swipe out my app (close the app). No event get fired, so I cannot close my service and I get a message "appname stopped".

    Greets,

    John
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Are you using a foreground service? If not then the process will be killed immediately when the user swipes it out of the recent apps. You should check the logs and see why your app is crashing after it was killed. It shouldn't.
     
  3. jayel

    jayel Active Member Licensed User

    the strange thing is that i do not see any error
     
    Last edited: Jun 22, 2015
  4. Erel

    Erel Administrator Staff Member Licensed User

    Are you testing it in Release mode? Are you using usb debug mode?
     
  5. jayel

    jayel Active Member Licensed User

    in debug mode (wifi)
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    The process is killed and then the OS tries to recreate it. However as it is a debug build it cannot start. You should test it in release mode.

    Note that you can only see the logs in debug mode when connected with B4A-Bridge.
     
  7. jayel

    jayel Active Member Licensed User

    Erel,

    Just tested it in release mode and i still get errors.
    And in my log window i don't see anithing unussual.
     
  8. jayel

    jayel Active Member Licensed User

    I have following on top of my service :
    Code:
    #Region  Service Attributes
        
    #StartAtBoot: false
        
    #StartCommandReturnValue: android.app.Service.START_STICKY
    #End Region
    Could this affect something?
     
  9. Erel

    Erel Administrator Staff Member Licensed User

Loading...