Open n0m0r3pa1n opened 9 years ago
This happens to me if i press the back button ! i'm on a nexus 5 with Cm 12.1
I commented the code in the onUnbind method of the BubblesService and made the service extend IntentService and now I think that everything is OK. Also the back button is working. Is that a fix?
public BubblesService() {
super("BubblesService");
}
...
public boolean onUnbind(Intent intent) {
// for (BubbleLayout bubble : bubbles) {
// recycleBubble(bubble);
// }
// bubbles.clear();
return super.onUnbind(intent);
}
...
@Override
protected void onHandleIntent(Intent intent) {
}
In the BubblesManager in the recycle() method comment the:
//context.unbindService(bubbleServiceConnection);
This will keep the connection alive and the service won't be recycled.
@n0m0r3pa1n This code is a great approach to your goals, but IMHO not is a fix for all.
There is solution: http://stackoverflow.com/a/2476962
Sooner or later the service is killed again. I tried this method. I see that Facebook Messenger is using startForegroundService for its chat bubbles. I read that it has longer life so it may be the solution.
@n0m0r3pa1n Thanks for pointing out. That would be an appropriate approach to this issue.
The bubble stays no more than 5 minutes and after that the system kills the service and it recycles the bubbles. This happens on Nexus 4 with Android Lollipop 5.1.1