How to stop service when ACTION_SCREEN_OFF

前端 未结 4 1812
礼貌的吻别
礼貌的吻别 2021-01-14 11:56

I am trying to make my UpdateService for my digital clock widget stop when the screen is turned off to conserve battery, and then back on when the screen is activated. I cur

4条回答
  •  有刺的猬
    2021-01-14 12:57

    I'm fairly sure that you have to register your receiver in code for ACTION_SCREEN_OFF/ON. I don't think registering them in the manifest will work.

提交回复
热议问题