Android Question StartService long process doesn't stop

Luiz Fernando Orlandini

Active Member
Licensed User
Longtime User
Hi All.

I have implemented a long duration service, cause I need to run a webservice call every 30 seconds.

B4X:
Sub Service_Start(StartingIntent As Intent)   
        'my app code       
    StartServiceAt(Me, DateTime.Now + 30 * 1000, False)
End Sub

When I start the service I used to call

B4X:
    StartService(GPSTrack)

And when I decided that is not necessary to execute the service any more, I call

B4X:
    StopService(GPSTrack)

In the first moment, looks that the service stops. But when I finish my APP, after some seconds, the service starts to log my position again.

How can I definitely stop the service, and stop to log my position.

Can anybody help me?

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
You are missing a
B4X:
CancelScheduledService(GPSTrack)
before you stop the service i suppose
 
Upvote 0
Top