0

I basically want to check if the phone has been idle for a specific amount of time and if that is true then it should do some activities ... so is there any way to do so ?

Terry Jan Reedy
  • 18,414
  • 3
  • 40
  • 52
Hasan
  • 36
  • 1
  • 16

1 Answers1

0

Answered here: How to find the screen is locked in android

Then you can start your timer (i.e. with a handler) and do your thing

Community
  • 1
  • 1
Carsten
  • 806
  • 5
  • 6
  • Sorry that did not really help, do you have any link for an example of action_user_present – Hasan Oct 24 '14 at 14:47
  • What shouldn't this help? As mentioned in the answer that I linked you register a BroadcastReceiver for Intent.ACTION_SCREEN_OFF & Intent.ACTION_SCREEN_ON In your broadcast receiver, when you receive Intent.ACTION_SCREEN_ON, you can check if the screen is locked. If it is locked you start your timer and have what you need. – Carsten Oct 24 '14 at 14:54