Android广播接收器会消耗电池寿命吗? [英] Do android broadcast receivers consume battery life?

查看:78
本文介绍了Android广播接收器会消耗电池寿命吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个接收器正在监听 android.intent.action.BOOT_COMPLETED android.intent.action.PACKAGE_REPLACED .我想知道由于它们导致我的应用程序现在持续运行,它们导致我的手机消耗了多少电池寿命.

I have two receivers that are listening for android.intent.action.BOOT_COMPLETED and android.intent.action.PACKAGE_REPLACED. I was wondering how much battery life they are causing my phone to consume since they cause my app to constantly run now.

推荐答案

广播接收器本身不会直接消耗大量电池寿命. BOOT_COMPLETED 发生一次; PACKAGE_REPLACED 仅在应用程序升级时发生.那些人平均每天可能会发生一个事件.

The broadcast receivers themselves will not directly consume much battery life. BOOT_COMPLETED happens once; PACKAGE_REPLACED happens only on an application upgrade. Those probably average one event per day.

现在,如果那些广播接收器还进行其他工作,例如启动服务,则 可能会对电池产生重大影响……但这是服务的问题,而不是接收器本身的问题.

Now, if those broadcast receivers do other stuff, such as starting services, that may have significant battery implications...but that is a problem with your services, not with the receivers themselves.

这篇关于Android广播接收器会消耗电池寿命吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆