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:

  1. activity starts service , binds it
  2. activity gets killed, service keeps running, onunbind() called
  3. activity starts again, , binds running service
  4. 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

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -