When is a safe time to set the default UncaughtExceptionHandler?

In the implementation I assume its important to call through to
whatever the system default is?

Therefore, I assume its important to wait until the system default has
been set...

Then I can do something like:

final UncaughtExceptionHandler ueh =
Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler
() {
        @Override
        public void uncaughtException(Thread thread, Throwable ex) {
                // ...
                // MY STUFF GOES HERE (for example, grab the
Build.MODEL and Build.ID and then report it)
                // ...
                if (ueh != null) {
                        ueh.uncaughtException(thread, ex);
                }
        }
});

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to