I'm looking to implement a feature that logs out the user after X minutes of inactivity. After going through a similar answer on SO, the suggested method seems to be to -
- Have a timer running in the background. Schedule it to timeout after x minutes.
- In every function where the user interacts with the app (basically all event handlers), call a method that resets the timer.
I can't think of anything better than this myself, but it's seems to be a huge pain even for a medium sized application that has 6-7 different screens and a whole bunch of UI components. Is there a better way to handle this?
Thanks,
Teja.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…