繁体   English   中英

在滑行中处理IllegalArgumentException(“你无法为被破坏的活动开始加载”)的最佳方法是什么?

[英]what is the best way to handle the IllegalArgumentException(“You cannot start a load for a destroyed activity”) in glide?

我的应用程序有时会崩溃,日志中出现的异常是:

llegalArgumentException("You cannot start a load for a destroyed activity")

鉴于我不希望我的应用程序崩溃,有什么可能的解决方法? 我应该修改库代码还是捕获库中的异常( RequestManagerRetriever.java ):

@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
private static void assertNotDestroyed(Activity activity) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && activity.isDestroyed()) {
        throw new IllegalArgumentException("You cannot start a load for a destroyed activity");
    }
}

解决方法是不“为破坏的活动启动负载”。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM