Is there an easy way to have the history stack cleared after a period of time?
I need to return to the log in screen either 1) after a period of time, or 2) after certain session variables no longer exist. I’m not sure how I can achieve this.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I am going to assume that “session variables” — which neither Java nor Android have — are really static data members. In that case:
Step #1: Have one of the “session variables” be the time of last login.
Step #2: In
onResume()of each activity, check the last-login “session variable” to see if it isnullor is too old — in which case, you callstartActivity()to launch your log-in screen.Step #3: There is no Step #3.