Android Question Is it OK to do .StartForeground in Starter service when I want a Notification to always be shown?

JohnC

Expert
Licensed User
Longtime User
My app is sort of a timer app that needs to continuously display a countdown clock as an always-displayed notification.

So, is it ok to do the below in the "Starter" service for this particular app purpose?
B4X:
Service.StartForeground(MyApp.nid, MyApp.CreateNotification("MyApp","Timer: xx:xx:xx"))
 

DonManfred

Expert
Licensed User
Longtime User
So, is it ok to do the below in the "Starter" service for this particular app purpose?
No

 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
What exactly does 'It will not work once the backed service is destroyed" mean?

What is a "Backed Service"?

The reason why I asked this question is that I was having trouble keeping my app running every minute by using a separate service and StartServiceAt(). On an Oreo 8.1 device, the app would just stop during the night.

But when I use the Starter service as the only service, the app kept running all night long.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…