BAcevedo
BAcevedo

Reputation: 127

How to make an android service that runs a notification persistent

I want the service to keep running even when the app is killed by the phone(When it needs RAM for other apps).

Is there a way to do this?

Upvotes: 0

Views: 471

Answers (2)

tyczj
tyczj

Reputation: 74066

The best you can do is use startForeground which make it less likely for your service to get killed but it is still possible for it to get killed.

There is no way to guarantee you service stays alive forever

Upvotes: 0

MrMox
MrMox

Reputation: 21

No, you can only make your service persistent if you are developing system apps. These services will be basically un-killable.

Upvotes: 1

Related Questions