From 340217e922c493383eb68ed66a33ddf40a70f03c Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 6 Oct 2022 18:15:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=9B=B4=E6=92=AD=E9=97=B4?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD.9=E5=9B=BE=E6=94=B9=E4=B8=BA=E7=94=B1Glide?= =?UTF-8?q?=E7=AE=A1=E7=90=86Bitmap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/utils/LoadDian9TuUtil.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/utils/LoadDian9TuUtil.java b/live/src/main/java/com/yunbao/live/utils/LoadDian9TuUtil.java index 340403b6f..47d5afe5e 100644 --- a/live/src/main/java/com/yunbao/live/utils/LoadDian9TuUtil.java +++ b/live/src/main/java/com/yunbao/live/utils/LoadDian9TuUtil.java @@ -33,15 +33,13 @@ public class LoadDian9TuUtil { } } Glide.with(context) - .asFile() + .asBitmap() .load(imgUrl) - .into(new CustomTarget() { + .into(new CustomTarget() { @Override - public void onResourceReady(@NonNull File resource, @Nullable Transition transition) { + public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition transition) { try { - FileInputStream is = new FileInputStream(resource); - setNinePathImage(context, imageView, BitmapFactory.decodeStream(is), position); - is.close(); + setNinePathImage(context, imageView, resource, position); } catch (Exception e) { e.printStackTrace(); }