https://github.com/bumptech/glide/issues/1484
非常好的解决方式
final Context context = getContext();
if (isValidContextForGlide(context) {
// Load image via Glide lib using context
}
public static boolean isValidContextForGlide(final Context context) {
if (context == null) {
return false;
}
if (context instanceof Activity) {
final Activity activity = (Activity) context;
if (activity.isDestroyed() || activity.isFinishing()) {
return false;
}
}
return true;
}