views:

250

answers:

1

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?

+8  A: 

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.

CommonsWare
perfect, that is just what i was looking for. Thank you.
Segfault