开发者

Service is not getting disconnected on calling unBindService()

开发者 https://www.devze.com 2023-02-19 23:21 出处:网络
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 th

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号