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 ?
Asked
Active
Viewed 64 times
0
-
Define idle? User not interacting? Phone not being moved? – reactivemobile Oct 24 '14 at 14:19
-
idle = phone not unlocked – Hasan Oct 24 '14 at 14:19
1 Answers
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
-
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