Reputation: 1307
I have a requirement and for that, i have to check if an android phone is idle, i.e user didn't unlock the phone nor answered any call for some specific amount of time. Is there any way to check this condition?
Upvotes: 1
Views: 171
Reputation: 82533
Monitor the SCREEN_ON
and SCREEN_OFF
broadcasts. If the SCREEN_ON
broadcast is not sent for the time you want after a SCREEN_OFF
broadcast, then the user hasn't used his phone for that amount of time.
Upvotes: 1