I made an application and i saved the username and password for the rest of the application through getsharedpreferences in android and i use it. Now i need to log out when the application is closed…how to do it?
Share
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.
Take a look at the activity lifecycle. There you can see that onStop and onDestroy are called every time the activity lifecycle ends. So you could overwrite on of these two methods. Depending on your exact requirements it may also be necessary to overwrite onPause.