本文介绍了可以启动并绑定服务生活"永远的QUOT;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,一个服务可以在两种模式下运行,开始和束缚。

我不十分从这个网站的开发者文档或其他问题明白了,无论是运行既是一项服务从开始到最后一个组件从它解除绑定绑定会退出​​?

解决方案

如果一种叫 startService()服务,它仍将是不管什么<$ C运行时, $ C> bindService()和 unbindService()通话可能已经上。最终,Android将停止服务,或者用户会杀死服务,但也将在最后的 unbindService()

立即执行

I understand that a service can run in two modes, started and bound.

What I don't quite understand from the developer docs or other questions on this site, is whether a service running as both started and bound will exit when the last component unbinds from it?

解决方案

If something called startService() on the Service, it will remain running, regardless of what bindService() and unbindService() calls may have gone on. Eventually, Android will stop the service, or the user will kill the service, but neither will happen immediately upon the last unbindService().

这篇关于可以启动并绑定服务生活&QUOT;永远的QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 02:28