0

I know how to use UncaughtExceptionHandler within my Application.onCreate to catch unhandled exceptions. But, this handler catches only those exceptions thrown in my UI or main thread. So I have to define a separate handler for every thread in my app.

Is there any way of catching ALL unhandled exceptions in one place?

Joseph_Marzbani
  • 1,796
  • 4
  • 22
  • 36
  • http://stackoverflow.com/questions/2764394/ideal-way-to-set-global-uncaught-exception-handler-in-android/ – fadden Feb 20 '14 at 19:52

1 Answers1

0

I am not sure if that would work for Android but I have been using this for Java SE apps for a while:

setDefaultExceptionHandler

It should be working for all threads since it is static method and explicitly states in the documentation that it is "the last resort" handler if neither Thread or ThreadGroup has any handlers.

similar question

Community
  • 1
  • 1