Do android broadcast receivers consume battery life?

不打扰是莪最后的温柔 提交于 2019-12-30 09:32:18

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/4549635/do-android-broadcast-receivers-consume-battery-life

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!