From 33e50f547225d301d1b6003e1b09574fab3f62e9 Mon Sep 17 00:00:00 2001 From: kongzue Date: Sat, 7 Aug 2021 12:25:19 +0800 Subject: [PATCH] 0.0.41.beta16.. --- .../java/com/kongzue/dialogx/interfaces/BaseDialog.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/DialogX/src/main/java/com/kongzue/dialogx/interfaces/BaseDialog.java b/DialogX/src/main/java/com/kongzue/dialogx/interfaces/BaseDialog.java index f3361ae8..d013f01b 100644 --- a/DialogX/src/main/java/com/kongzue/dialogx/interfaces/BaseDialog.java +++ b/DialogX/src/main/java/com/kongzue/dialogx/interfaces/BaseDialog.java @@ -90,13 +90,16 @@ protected static void error(Object o) { } public static void onActivityResume(Activity activity) { - if (runningDialogList!=null) { - for (BaseDialog baseDialog : runningDialogList) { + if (runningDialogList != null) { + CopyOnWriteArrayList copyOnWriteList = new CopyOnWriteArrayList<>(runningDialogList); + for (int i = copyOnWriteList.size() - 1; i >= 0; i--) { + BaseDialog baseDialog = copyOnWriteList.get(i); if (baseDialog.getActivity() == activity && baseDialog.isShow && baseDialog.getDialogView() != null) { View boxRoot = baseDialog.getDialogView().findViewById(R.id.box_root); if (boxRoot != null) { log("DialogX: boxRoot is requestFocus."); boxRoot.requestFocus(); + return; } } }