-2

My android app has a main login screen and various screens which follow. I want to create a session timeout dialog which shows up when: 1) the user is on any page except the login page and 2) the user has not interacted with the application for 5 minutes.

The session timeout dialog should have a logout button which takes the user back to the login screen. How do I do this?

quartz
  • 69
  • 2
  • 6
  • _the user has not interacted with the application for 5 minutes_ for this you can use `Timer` , `CountDownTimer` etc etc. Many options. You need to save your time in shared preference – Piyush Aug 05 '16 at 10:31

1 Answers1

1

Do this

Get the time stamp when ever user interacts with the app. Compare it with previous time stamp and get the difference.

Now if difference is more than 5min, prompt a dialog with logout button.

Logic
  • 2,230
  • 2
  • 24
  • 41