how to check whether an application has closed in android?
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 d开发者_如何学Pythono it?
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.
精彩评论