Reputation:
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?
Upvotes: 0
Views: 815
Reputation: 1611
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
Upvotes: 1