I run a service by put StartServiceAt command under Sub Service_Start.
How do I stop this service when quit from app?
I put this code when quit from app
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
If KeyCode = KeyCodes.KEYCODE_BACK Then
StopService(MyService)
ExitApplication
End If
End Sub
But the service still running, the only way to stop it is reboot my device.