IIUC should be an example of a given Android service, this is a singleton.
However, my service often enters, though I do nothing for it.
When the service crashes (for example, when I uninstall the app via ADB), it is scheduled to resume ("Service .."). I understand that this service has the effect of being sticky.
After this, when my app starts, it calls startService () and bindService (), and the service starts properly and is bound. But then the service has been reinstalled and the crete () is called repeatedly because it was scheduled to restart several times.
Each example then waits for the client to bind and register, but wait only for the on () bind to the "main" service example additional examples the customer, and it does not That's why they call StopSelf ().
But StopSelf () is not absolutely impressed in these "dead" examples, Destory () is never called.
The "main" service example works as expected, and when the decision to call StopSaal (), then Direrey () is actually called.
Worse, these dead incidents accumulate, they are never destroyed, therefore, their only possible ending is an accident (which is every time I get established through launch / ADB ), And thus restarts.
So in the end, I get these dead incidents, which are the restart once in a row, progressively from the minute.
Do anyone know what's going on?
Because I have not seen your code, this is just an estimate: maybe you have a memory leak that This is the only reason that I could think of getting many examples of service. For example, if your service is on some objects that also refer to your service. It does a lot with internal organs
Watch this video from Google I / O to see how this problem applies to your services and how it is obtained:
Comments
Post a Comment