[英]how to know whether a process(app) has been killed?
when a app has caused a exception and been killed ,how can i catch this info to clear some resources associated with this app? 当某个应用导致异常并被杀死时,如何捕获此信息以清除与此应用相关的某些资源? are there some servers to service for this situation?
有一些服务器可以为这种情况服务吗?
for example, my app will generate some notification,and the app may cause a exception,how to clear the notifications when the app be killed? 例如,我的应用程序将生成一些通知,并且该应用程序可能会导致异常,当该应用程序被杀死时如何清除通知?
If you are concerned about an Exception causing termination of your application, you could make use of the Thread.UncaughtExceptionHandler and perform your cleanup. 如果您担心导致应用程序终止的异常,则可以使用Thread.UncaughtExceptionHandler并执行清理。
Take a look at how ACRA makes use of this to send crash reports. 看一下ACRA如何利用它发送崩溃报告。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.