开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜