Android Question SMS Interceptor and Service

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

  1. kohle

    kohle Active Member Licensed User

    Hi,
    I have an activity and a service. the service run as foreground service.
    In the service I use a sms interceptor :
    Sub SI_MessageReceived (From As String, Body As String) As Boolean

    The application runs fine.

    When I go to the task manager and close the application, the service is
    still running. If I click on the icon in the status bar the app open. Perfect.
    The main activity starts again.

    The problem :
    When I go to the task manager and close the application, the service is
    still running. Now a sms comes in.
    The service close automatically, no error nothing.

    I log the SI_MessageReceived event, but it dont enter anymore there.

    What this can be ?


    Installing file.
    ** Activity (main) Pause, UserClosed = false **
    sending message to waiting queue (CallSubDelayed - HeartBeat)
    sending message to waiting queue (CallSubDelayed - HeartBeat)
    sending message to waiting queue (CallSubDelayed - HeartBeat)
    sending message to waiting queue (CallSubDelayed - HeartBeat)
    sending message to waiting queue (CallSubDelayed - HeartBeat)
    sending message to waiting queue (CallSubDelayed - HeartBeat)
    sending message to waiting queue (CallSubDelayed - HeartBeat)
    PackageAdded: package:JK.TESTApp
    ** Activity (main) Create, isFirst = true **
    ** Activity (main) Resume **
    ** Service (sv_control) Create **
    ** Service (sv_control) Start **
    ** Activity (main) Pause, UserClosed = false **




    rgs
    Jürgen
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    If the user explicitly kills your app then the service will not receive any intents until the user explicitly starts it again.
     
  3. kohle

    kohle Active Member Licensed User

    Is it like this,
    in the notifaction bar it shows the last notifacation of my service. This notifaction has a link
    to start my app again.

    When the user kill my main activity (shown in the task list) than the service is stopped
    too, but the notification stays in the notifaction list.

    So when a sms receive the notification list is updated and the service notifaction dont appear anymore
     
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