Android Question STOP - DESTROY / service with STARTSERVICEAT and keepalive

petr4ppc

Well-Known Member
Licensed User
Longtime User
Dear friends,
please how can I stop this service?

B4X:
Sub Process_Globals    
   Dim pw As PhoneWakeState
End Sub

Sub Service_Create
End Sub

Sub Service_Start (StartingIntent As Intent)
    Log(DateTime.Time(DateTime.Now))
    StartServiceAt("", DateTime.Now + .25 * 60 * 1000, True)
    pw.KeepAlive(True)
End Sub

Sub Service_Destroy
pw.ReleaseKeepAlive 'I am trying this
End Sub

I am trying it to stop with using
in MAIN: StopService(DeviceWakupService)

and In process (sub process destroy) with:
pw.ReleaseKeepAlive
pw.KeepAlive(False)

but the proces still live....
Please how can I stop it?
Thank you very much
Best regards
p4ppc
 
Last edited:
Top