0

I want to implement an auto user logout after an idle time of X mins in my project. So I have googled for relevant examples but they cant seem to debug properly with my existing codes. My intentions are to utilize:

-a BackgroundProcessingService extend Service
-a CountDownTimer

Can anyone help me with a basic auto user logout program?

1 Answers1

1

How you can achieve user-inactivity auto logout:

  • Use your ideal XX minute in prefrences.

  • start an AlarmManager with the help of BroadcastReceiver.

  • the ideal time you want put in the AlarmManager and when Receiver called , call Logout programmatically.

I used these step and it's working.

If you have any problem with these step.

feel free to ask

Akarsh M
  • 1,629
  • 2
  • 24
  • 47
  • what do you mean by use my ideal XX minutes in preferences?? could you please illustrate? –  Aug 20 '14 at 09:01
  • I have added this code into my existing program, but when debugged, it doesn't work, pls advise: –  Aug 21 '14 at 03:41
  • have you declare Broadcast Receiver in Manifest file – Akarsh M Aug 21 '14 at 14:24
  • no code now, I made this demo along back. Please try these stepand let me know if you faced any issue @RaseemAyatt – Akarsh M Oct 14 '16 at 07:31