Android Question [SOLVED] StopAutomaticForeground when the task completes

lemonisdead

Well-Known Member
Licensed User
Longtime User
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:

Erel

B4X founder
Staff member
Licensed User
Longtime User
For example when you have a constant background service which has to be started at boot, do you never call StopAutomaticForeground ?
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

Jorge M A

Well-Known Member
Licensed User
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.

You should either call StopService(Me) or Service.StopAutomaticForeground when it is no longer important that the service will be kept in foreground mode.

The specific question is, what happend with httpjob.done if I invoke the StopService at that moment?

Thanks a lot!
 
Last edited:
Upvote 0
Top