From 0e870a0d919a28a45084a7df5f662afbfd7e086d Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 15 十二月 2020 14:44:28 +0800
Subject: [PATCH] DownloadAndSetImageTask和SetImageTask两个类由于在子线程执行,会经常出现activity关闭后继续执行导致报错崩溃问题,修复此bug
---
app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseTakePicActivity.kt | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseTakePicActivity.kt b/app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseTakePicActivity.kt
index 46f614c..9c15188 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseTakePicActivity.kt
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseTakePicActivity.kt
@@ -12,6 +12,7 @@
import cn.flightfeather.thirdapp.util.UUIDGenerator
import cn.flightfeather.thirdapp.util.file.FileUtil
import cn.flightfeather.thirdapp.util.photo.PhotoUtil
+import com.bumptech.glide.Glide
import com.lcw.library.imagepicker.ImagePicker
import org.jetbrains.anko.toast
import java.io.File
@@ -91,9 +92,11 @@
when {
i < picSize -> {
imageViewList[i].setOnClickListener(viewPhotoClickListener(i))
- // fixme: 2019/8/2 姝ゅ缁檌mageVIew璁剧疆鍥剧墖鍦ㄥ師浠g爜涓槸鑷畾涔変簡涓�涓狝syncTask锛屼箣鍚庡彲浠ョ敤Glide绛夌涓夋柟妗嗘灦鏇夸唬
imageViewList[i].scaleType = ImageView.ScaleType.CENTER_CROP
- SetImageTask(pathTempList[i].first, imageViewList[i]).execute()
+ Glide.with(this)
+ .load(pathTempList[i].first)
+ .placeholder(R.drawable.icon_add_photo_waite)
+ .into(imageViewList[i])
}
i == picSize -> imageViewList[i].run {
setOnClickListener(takePhotoClickListener(i))
--
Gitblit v1.9.3