Android 服务 - stopSelf() 没有做它应该做的事情
我的应用程序在后台运行一个未绑定的服务。 我希望该服务能够在满足某些条件时自行停止。我尝试打电话,
stopSelf();
但这不起作用。该服务仍在运行并耗尽内存。最奇怪的部分是它
onDestroy()
在调用 StopService() 之后经历......这让我感到困惑。为什么经过了onDestory()之后它还在那里?
I have an unbound service running in the background for my application.
I want to the service to be able to stop itself if some conditions are met. I tried calling
stopSelf();
but this doesn't work. The service is still running and using up memory. The weirdest part is that it it goes through
onDestroy()
after calling StopService()... This is what makes me confused. Why is it still there if it went through onDestory()?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论