as mentioned here, when the screen goes off, the onStop()
of current Activity will be called. I need to check the screen on/off status when the onStop()
of my Activity
is called. so I have registered a BroadcastReceiver
for these actions(ACTION_SCREEN_ON
AND ACTION_SCREEN_OFF
) to record the current on/off status(and they work properly, I have logged!).
but when I turn off the screen and check the on/off status in the onStop
, it says the screen is on. why? I think the receiver must receive the ACTION_SCREEN_OFF
before onStop
is called so what's wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…