What do I want to achieve:
After 3 minutes of user inactivity I want to display a new activity.
Research:
I did look on Stackoverflow for this problem and I found some hints on how to do this using a background thread, create a base activity that register the last touch, etc.
Problem:
If I have more than, lets say 20 activities, and I don't want to extend all activities from a base Activity. This would mean that every time I create a new activity I need to extend this base one, which can create some mess if my activities already extends from some other base activities. I would like to use the class Application to handle this, so the activities would remain the same.
How can I achieve this without touching activities already created? Or do I always have to handle onUserInteraction()
, or onPause()
, or any other methods on Activity?
Research references: