is it possible to replace the default “Force Close” dialog in Android?

荒凉一梦 提交于 2019-12-31 10:52:05

问题


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?


回答1:


You cannot do what the subject line states from an SDK application.

However:

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?

Use Thread.setDefaultUncaughtExceptionHandler().

Also, consider using Flurry or DroidDrop or something for the actual delivery of your exception data.




回答2:


You could also use Bugsense.com to get your exception data (it's free).

PS: I am the founder :)



来源:https://stackoverflow.com/questions/2314139/is-it-possible-to-replace-the-default-force-close-dialog-in-android

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