android - Unbinding a service from an activity other its originator -
how can go unbinding service after i've moved different activity? main problem no longer have reference original serviceconnection in new activity, can't call unbindservice. there way pass serviceconnection new activity, or can grab reference service other way?
i think better if this:
1- start service calling startservice().
2- bind() activity service in oncreate() or onresume()
3- interact it
4- unbind() activity service in onpause() or ondestroy()
repeat #2 #3 #4 other activities
5- once done service, stop calling stopservice()
Comments
Post a Comment