Reputation: 2564
I have an app, with a Service
that is supposed to run all the time, and for some fixed periods of time, to send a notification to the user informing him of an available action. So if the service runs fine without being killed its ok, but if the phone runs low on memory and stops the Service, first of all, it doesnt even enter in the onLowMemory
method of the service, and even though in the onStartCommand
i am returning START_STICKY, the service isnt being recreated again any time soon..... So first of all, how can I make the service tell Android that it should be started again when memory is available, and if this is the right approach at all, to fire the notifications with a Service, or should I use some other class like AlarmManager?
Upvotes: 0
Views: 54
Reputation: 49986
I belive you have encountered problem that is issued as a bug here:
https://code.google.com/p/android/issues/detail?id=63793
but probably google finds it more like a feature.
If your service is supposed to run all the time then think about making it foreground service.
Upvotes: 1