Handle app closing event from Launcher's menu

喜欢而已 提交于 2019-12-05 21:15:06

I want to do some operations when user closes the app.

That is not possible. Your process is simply terminated, with no notice.

Isn't there anything like onApplicationDestroy()?

No.

Is is possible to make connection with server and pass some values when user closes app in this way?

No.

Note that there is nothing significantly different between the user swiping your app off the recent-tasks list (what you depict in your question) and various other scenarios, including:

  • Android terminating your background process to free up memory for other applications

  • Users terminating your background process using a third-party task maanger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!