1

I'm trying to make an app that warns you when you stop using your phone for a while (so I dont stop doing my work). The functionality would be similar as a screensaver, after some minutes of inactivity would pop a annoying message. So, I made a service and I try to detect a onUserInteraction() to restart a timer that pops the massage, but that doesn't seem to work like would in a activity. Are there other ways of detecting inactivity or a more intelligent way to do this thing? thank you very much.

jeremyjjbrown
  • 7,772
  • 5
  • 43
  • 55

1 Answers1

0

You could register for the " android.intent.action.SCREEN_ON" intent in your manifest, and set a timer with AlarmManager.

ross.squires
  • 405
  • 3
  • 13