用于服务的 Gingerbread 电源管理
根据 http://developer.android.com/sdk/android-2.3-highlights .html 除了系统内存不足之外,现在还有其他情况可能导致后台服务被终止:
Android 系统在管理使设备长时间处于唤醒状态或在后台运行时消耗 CPU 的应用程序方面发挥着更积极的作用。通过管理此类应用程序(如果合适则关闭它们),系统有助于确保最佳性能和最长电池寿命。
是否有可能发生此类进程终止的情况列表?有没有办法检测到这种情况并优雅地处理它?
最后,在这种情况下,将服务设为前台服务有帮助吗?
According to http://developer.android.com/sdk/android-2.3-highlights.html there are now circumstances other than low system memory that can result in background services being killed:
The Android system takes a more active role in managing apps that are keeping the device awake for too long or that are consuming CPU while running in the background. By managing such apps — closing them if appropriate — the system helps ensure best possible performance and maximum battery life.
Is there a list of the circumstances under which such a process killing can occur? Is there a way to detect this circumstance and handle it gracefully?
Finally, does making a service a foreground service help in this case?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论