lemonisdead Well-Known Member Licensed User Longtime User Mar 14, 2018 #1 Hello, Sorry but I don't get it : does "StopAutomaticForeground when the task completes" mean "when the service has to be stopped" ? For example when you have a constant background service which has to be started at boot, do you never call StopAutomaticForeground ? Or perhaps only put it in foreground when it has to do something ? Or perhaps do I have to use another service to wake up the one which has to do something ? Or another idea : StopAutomaticForeground and after that StartForeground ? Many thanks Last edited: Mar 14, 2018
Hello, Sorry but I don't get it : does "StopAutomaticForeground when the task completes" mean "when the service has to be stopped" ? For example when you have a constant background service which has to be started at boot, do you never call StopAutomaticForeground ? Or perhaps only put it in foreground when it has to do something ? Or perhaps do I have to use another service to wake up the one which has to do something ? Or another idea : StopAutomaticForeground and after that StartForeground ? Many thanks
Erel B4X founder Staff member Licensed User Longtime User Mar 15, 2018 #2 lemonisdead said: For example when you have a constant background service which has to be started at boot, do you never call StopAutomaticForeground ? Click to expand... No. You shouldn't call it in that case. You should either call StopService(Me) or Service.StopAutomaticForeground when it is no longer important that the service will be kept in foreground mode. Upvote 0
lemonisdead said: For example when you have a constant background service which has to be started at boot, do you never call StopAutomaticForeground ? Click to expand... No. You shouldn't call it in that case. You should either call StopService(Me) or Service.StopAutomaticForeground when it is no longer important that the service will be kept in foreground mode.
Jorge M A Well-Known Member Licensed User Longtime User Mar 23, 2018 #3 EDITED: Please ignore this. Sorry for intruding in this thread, but I think my question is at least half inside the topic.(maybe should I start another thread?). I have been digging for few days in the Forum, but can not find something related. My situation is that I have a Service that implement three simultaneous calls to web api's using httpjobs thant retrieve long lists of information. The user can exit the application and even remove it from the tasks list while the service is downloading the information, so it is no longer important to maintain service in the backgroud. Erel said: You should either call StopService(Me) or Service.StopAutomaticForeground when it is no longer important that the service will be kept in foreground mode. Click to expand... The specific question is, what happend with httpjob.done if I invoke the StopService at that moment? Thanks a lot! Last edited: Mar 24, 2018 Upvote 0
EDITED: Please ignore this. Sorry for intruding in this thread, but I think my question is at least half inside the topic.(maybe should I start another thread?). I have been digging for few days in the Forum, but can not find something related. My situation is that I have a Service that implement three simultaneous calls to web api's using httpjobs thant retrieve long lists of information. The user can exit the application and even remove it from the tasks list while the service is downloading the information, so it is no longer important to maintain service in the backgroud. Erel said: You should either call StopService(Me) or Service.StopAutomaticForeground when it is no longer important that the service will be kept in foreground mode. Click to expand... The specific question is, what happend with httpjob.done if I invoke the StopService at that moment? Thanks a lot!