简体   繁体   中英

How do i know whether android application explicitly killed by user or not?

I have an application which uses some resources internally.

Problem : if user explicitly removes application from recent apps list, it kills the entire application but i must close resources when application is killed explicitly.

Is there any callback method is calling when application is closed by the user ?

What's the difference if the user kill your app/ the system kill your app or just the user move to another app and put your app in background.

In any case you shouldn't leave open resources when you app isn't active. Just close all resources on onStop of your activity

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM