Android Question StartServiceAt

gerredtor

Active Member
Licensed User
Hello, what is the best way to start different Services (because of an Alarm) and end them if they are time based. E.g. i activate an Alarm clock which should start in a couple of hours, meanwhile I start some other Services, how can end the first one now without affecting the others. can i asign it an id or what is here the best solution?
 

fransvlaarhoven

Active Member
Licensed User
Longtime User
Hallo,

I have a foreground service that reschedules itself using StartServiceAt("", RestartAt, True)

This works fine with a lot of different devices.

However, it seems to be that some android implementations go into some kind of deep sleep mode that just ignores the scheduled restart of the service.

I also experimented with phonewakestate but nothing seems to avoid this problem.

Do you have a suggestion how to solve this problem?
 
Upvote 0
Top