已处理 'Uncaught Exception' 应用仍然崩溃

handled 'Uncaught Exception' still crashing the app

我在 android 中处理未捕获的异常如下

Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
    @Override
    public void uncaughtException(Thread thread, Throwable e) {
        handleUncaughtException(thread, e);
    }
})

public void handleUncaughtException(Thread thread, Throwable e) {
    Helper.logUncaughtExceptionToFile(e); // Just to log the exception
}

它对我来说工作正常,它处理异常,但是当异常发生时我的函数被调用然后应用程序崩溃。这是它应该如何工作吗?我不希望应用程序崩溃

只有与线程相关的异常被 handled.if 特定线程负责将数据提取到 UI 然后应用程序崩溃而没有生成 UI 所需的值。