i have implemented and inter-process communication using Binder in my android project. My activity & service开发者_StackOverflow中文版 are running the same application. i have disconnected from the service by calling unbindService(intent) & the service is destroyed. But am able to call the public method which is already destroyed... how to solve it?
Even if you unbind the connection of service, there is a chance that another connection still existed somewhere within the application. Therefore it's the best practice if you call stopService() in activity to destroy the service or stopSelf inside the Service itself.
精彩评论