用户清理后台程序此时想做一些动作 应该重载什么函数尝试了 finish 没有用啊
onSaveInstanceState和onRestoreInstanceState
系统杀调进程或是用户清理程序都是没办法监听到的,如果能监听到,那在杀掉的时候写个死循环岂不是永远杀不掉。如果要在退出acitivty前保存数据就在onSaveInstanceState回调中保存在bundle中,然后在onRestoreInstanceState恢复。