Andre Souza Member Licensed User Nov 25, 2015 #1 My app has a service that starts every time the app is opened for the Main every hour . Then it issues a notification . The service returns only if the user clicks the notification and so on. I wanted to know what command I can add on Main to see if the service is already scheduled, because every time you open the app , it always adds an extra hour . I've tried isPaused and not working . ::: MAIN ::: Code: Copy Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("ly_Home") StartServiceAt(SV_Notificar,DateTime.Now +3600 * 1000, True) End Sub :::MAIN::: Example Similar Code: Copy Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("ly_Home") if ServiceRunning() then StartServiceAt(SV_Notificar,DateTime.Now +3600 * 1000, True) End If End Sub An alternative that I thought was every time you start , compare time of the last notification clicked with the opening of the app to see if already spent an hour . Is it correct ?
My app has a service that starts every time the app is opened for the Main every hour . Then it issues a notification . The service returns only if the user clicks the notification and so on. I wanted to know what command I can add on Main to see if the service is already scheduled, because every time you open the app , it always adds an extra hour . I've tried isPaused and not working . ::: MAIN ::: Code: Copy Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("ly_Home") StartServiceAt(SV_Notificar,DateTime.Now +3600 * 1000, True) End Sub :::MAIN::: Example Similar Code: Copy Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("ly_Home") if ServiceRunning() then StartServiceAt(SV_Notificar,DateTime.Now +3600 * 1000, True) End If End Sub An alternative that I thought was every time you start , compare time of the last notification clicked with the opening of the app to see if already spent an hour . Is it correct ?
Erel B4X founder Staff member Licensed User Longtime User Nov 25, 2015 #2 It is not possible to find out whether a service is scheduled or not. You will need to track it yourself. Upvote 0
It is not possible to find out whether a service is scheduled or not. You will need to track it yourself.