Android Question Check if screen is off

apty

Active Member
Licensed User
Longtime User
How can i check if screen is off (or the phone is on sleep mode)? I would like to use ScreenOff phone event but i cant find a tutorial on the same. I would like to check if phone screen is off and then perform some tasks
e.g
Code: Copy
if <screen is off> then
perform task a
 
I have read it but still dont know how to use the phone event. Kindly help with sample code that checks if screen is off
 
Upvote 0
Thanks LucaMs. It works ..but once you put the screen on again for the second time, it doesn't work!
 
Last edited:
Upvote 0
Back
Top