问题描述
我想我的Android应用程序的用户有给我发电子邮件任何未捕获异常崩溃我的应用程序的堆栈跟踪的选项。原本我以为我会只是包装每一个切入点,我在try / catch块的应用程序,但也有太多太多,这些即使在我很小的应用程序,这是合理的。
所以,我所真正需要的是一个方法来指定一些方法是默认处理任何未捕获的异常。有什么建议?
您不能做的主题行国从SDK应用程序。
不过:
使用 Thread.setDefaultUncaughtExceptionHandler()
。
此外,考虑使用乱舞或DroidDrop或东西你的异常数据的实际交付。
I would like the users of my android app to have the option to email me the stacktrace of any uncaught exception that crashes my app. Originally I thought I would just wrap every entry point to my app in a try/catch block, but there are far too many of these even in my tiny app for this to be reasonable.
So what I am really looking for is a way to specify some method to be the default handler for any uncaught exceptions. Any suggestions?
You cannot do what the subject line states from an SDK application.
However:
Use Thread.setDefaultUncaughtExceptionHandler()
.
Also, consider using Flurry or DroidDrop or something for the actual delivery of your exception data.
这篇关于是否有可能替换默认"强制关闭"在Android的对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!