android - onUnbind not being called when binding the activity to a running service -
i have activity starts , binds service:
@override protected void onstart() { super.onstart(); intent intent = new intent(context, soundservice.class); context.startservice(intent); context.bindservice(intent, serviceconnection, context.bind_auto_create); } and unbind by:
@override protected void onstop() { context.unbindservice(serviceconnection); super.onstop(); } the service keeps running after closing activity. @ scenario:
- activity starts service , binds it
- activity gets killed, service keeps running,
onunbind()called - activity starts again, , binds running service
- activity gets killed,
onunbind()not called :(
why onunbind() not being called?
return true onunbind, next time if call bindservice again not onrebind called when last clients unbinds onunbind called system
Comments
Post a Comment