I created sample local service project as provided in Android Service article Extending the Binder class http://developer.android.com/guide/topics/fundamentals/bound-services.html.
Everything works fine. However the query is
With unbind(), service doesn't get stopped. Should i need to use stopSelf() explicitly if yes than what does unbind() does.
I have create sample project with three buttons -> start, stop and fetch
start --> to bind service
stop --> to unbind service
start --> to access method of service. (random number generation method)
Now access to:
start - binds the service
fetch - gets access to method of service
stop - unbinds the service
Here i excepted that service will be unbind and destroyed. However
Step 4: fetch - this method still works and generates random number whereas expected was some sort of exception or may be force close.
(onServiceDisconnected will not be called: since it will be called only in case of crash)