[英]Android BroadcastReceiver does'nt work when screen is turned off
I have a BroadcastReceiver with ACTION_BATTERY_CHANGED. 我有一个带有ACTION_BATTERY_CHANGED的BroadcastReceiver。 I get events only when the screen is turned on. 我只有在打开屏幕时才能获得事件。
I want to get events of battery change even if the screen is turned off? 即使关闭了屏幕,我也想获得电池更换事件? How? 怎么样?
如果将接收器放在清单中,则它应该一直存在。
I would say that it is generally not great form to ask the same question multiple times. 我会说,多次问相同的问题通常不是很好的形式。 I answered this question, for you, here: 我在这里为您回答了这个问题:
Android keep BroadcastReceiver while the app is closed 在应用关闭时,Android保留BroadcastReceiver
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.