开发者

Keep application active after the screen is turned off

开发者 https://www.devze.com 2023-02-10 03:04 出处:网络
I have a receive开发者_运维问答r in my app (public class SMSReceiver extends BroadcastReceiver) which works just fine - except when the screen turns off. After the screen has turned off, the receiver

I have a receive开发者_运维问答r in my app (public class SMSReceiver extends BroadcastReceiver) which works just fine - except when the screen turns off. After the screen has turned off, the receiver stops receiving SMSes. Is there any way to solved this?


I would say that you will have to start a service that will listen for these Broadcasts. this is what I am doing while listening for ON_TIMETICK, SCREEN_OFF, and SCREEN_ON. I could not get it to work any other way.

0

精彩评论

暂无评论...
验证码 换一张
取 消