android-discuss icon indicating copy to clipboard operation
android-discuss copied to clipboard

[问答]有什么办法获取到用户手动杀死应用的时间吗?

Open JokeenZhang opened this issue 6 years ago • 4 comments

因为蓝牙连接,所以想要获取用户杀死应用的时间就可以用来作为蓝牙断开的时间

JokeenZhang avatar Aug 08 '18 07:08 JokeenZhang

用application销毁时的时间?

biubiuqiu0 avatar Oct 14 '18 02:10 biubiuqiu0

@VongVia1209 那么怎么去获取application销毁时的时间呢?这个问题我用别的方式解决了——直接采取监听主界面声明周期,当然这也是跟我应用需求有关才能这么做。但是更彻底的解决方案我还是想知道

JokeenZhang avatar Oct 15 '18 09:10 JokeenZhang

用户杀死应用分几种吧。 1)最近任务列表里面杀死 2)设置-应用管理-找到应用-强制停止 3)卸载

  1. 在Activity里面的onDestory方法基本上都会回调吧。 2),3)估计就别想了。统计不到

caoguodong avatar Nov 13 '18 06:11 caoguodong

不,在最近任务列表里面杀死应用不会执行onDestroy

caoguodong [email protected] 于2018年11月13日周二 下午2:46写道:

用户杀死应用分几种吧。 1)最近任务列表里面杀死 2)设置-应用管理-找到应用-强制停止 3)卸载

  1. 在Activity里面的onDestory方法基本上都会回调吧。 2),3)估计就别想了。统计不到

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/android-cn/android-discuss/issues/719#issuecomment-438155968, or mute the thread https://github.com/notifications/unsubscribe-auth/AfxqPP_jziODPJv7TBr70wNn-AkhWFT8ks5uumrcgaJpZM4VzcT7 .

JokeenZhang avatar Nov 27 '18 12:11 JokeenZhang