Anil M
Anil M

Reputation: 1307

Is there any option to check if an android phone is idle for some specific time?

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

Answers (1)

Raghav Sood
Raghav Sood

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

Related Questions