Android Question Show notoficacion programmed to several hours

Cebuvi

Active Member
Licensed User
Longtime User
Hello,

I am working on an app that submits notifications several hours apart by a fixed or variable interval. For example, 10:00, 11:00 and 12:00.
After researching the forum I get it to work using a service in background and StartServiceAtExact but I have the following problems
  • if the interval is longer than 10 minutes, the first notification is made at the correct time, but the following notifications are moved 2 minutes. That is to say the first occurs at 10:00, the second at 11:02 and the third at 12:02 (that increase of 2 minutes this for an hour or for two hours)
  • when the interval is large the system sometimes kills the service and notifications stop occurring.
If anyone could help me, I’d appreciate it.
 

Cebuvi

Active Member
Licensed User
Longtime User
The solution may be to put Service.AUTOMATIC_FOREGROUND_WHEN_NEEDED?

If I call Service.StartForeground before StartServiceAtExact(Me, ral, True) or StartService(serv_Notif), when I stop the Foreground?

Thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…