A Azhar Active Member Licensed User Longtime User Sep 26, 2012 #1 Hi I would be grateful if someone can help (from the ground up) trying to get a service to load in the foreground since the service (and it's activity) always seems to terminate by Android after a few hours. I know StartForeground is in the Core library but the compiler doesn't recognise the command (and is not even an autocomplete option when typing the command. So currently in MAIN Activity_Pause... I have simply StartService(serviceBootup) How can this be changed to start in the foreground? Many thanks, Azhar
Hi I would be grateful if someone can help (from the ground up) trying to get a service to load in the foreground since the service (and it's activity) always seems to terminate by Android after a few hours. I know StartForeground is in the Core library but the compiler doesn't recognise the command (and is not even an autocomplete option when typing the command. So currently in MAIN Activity_Pause... I have simply StartService(serviceBootup) How can this be changed to start in the foreground? Many thanks, Azhar
Erel B4X founder Staff member Licensed User Longtime User Sep 26, 2012 #2 The command is Service.StartForeground. Upvote 0
A Azhar Active Member Licensed User Longtime User Sep 26, 2012 #3 Thanks for that. I was on the understanding you called the service.foreground from the Main activity which would replace the StartService command. I didn't realise it was called within the actual service itself with the view to promote it to the foreground. I'll test it now and hopefully still be active in the morning. Thanks again. Upvote 0
Thanks for that. I was on the understanding you called the service.foreground from the Main activity which would replace the StartService command. I didn't realise it was called within the actual service itself with the view to promote it to the foreground. I'll test it now and hopefully still be active in the morning. Thanks again.
Erel B4X founder Staff member Licensed User Longtime User Sep 27, 2012 #4 You can read more about it here: Service Modules Upvote 0