gpt4 book ai didi

java - 安卓 :Activity is blocking with black screen when it occur Exception

转载 作者:行者123 更新时间:2023-12-01 09:16:39 24 4
gpt4 key购买 nike

如果我的代码有错误,Activity 将被黑屏阻止。但它不会抛出任何异常,仅在Android Monitor中抛出单行字。

11-09 17:03:03.984 14252-14262/? I/art: Starting a blocking GC HeapTrim
11-09 17:03:03.986 14252-14258/? I/art: Debugger is no longer active

在此Activity中,所有异常均未抛出。谁能告诉我为什么?

最佳答案

我自己捕获了异常。

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

关于java - 安卓 :Activity is blocking with black screen when it occur Exception,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40503202/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com