I am new to Android App development.I have a small issue.Working on my Android Application if hit on "Home" Button the application goes to background after some time again if go to "Home" and click my app icon it again getting started from my last viewed
Activity
(screen). Till now its fine,instead of last viewed screen , here i want to Logout automatically and it should show message like "Your Session timed out So Please Login again " or redirect to Login page " Then check the credentials and Allow the user to continue the same application . I am maintaining all the user credentials i.e email,username ,password and user id through out my application by using shared Preference.How to achieve this automatic Logout from application after few hours if it is in background in android or if the application is not used by the user or remains inactive for some times??
Waiting for Your suggestion ??