StartForeground Problems

Azhar

Active Member
Licensed User
Longtime User
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
 

Azhar

Active Member
Licensed User
Longtime User
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
Top