thread exiting with uncaught exception: NO stack trace

前端 未结 3 1592
心在旅途
心在旅途 2020-12-31 10:50

My application is causing a force close somewhere but instead of getting a FATAL EXCEPTION with the usual (and very informative) stack trace in my LogCat, I only receive onl

3条回答
  •  渐次进展
    2020-12-31 11:13

    I know this is old but if anyone else wants to know about exiting as normal after dealing with the uncaught exception:

    final Thread.UncaughtExceptionHandler androidDefaultUEH = Thread.getDefaultUncaughtExceptionHandler();
    
    Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
                @Override
                public void uncaughtException(final Thread thread, final Throwable ex) {
                    // Handle exception however you want, then:
                    androidDefaultUEH.uncaughtException(thread, ex);
                }
            });
    

提交回复
热议问题