Skip to content

Commit 44adc7d

Browse files
committed
Workaround for java.lang.IllegalArgumentException: View=DecorView@2d8132f[PayPwdDialogActivity] not attached to window manager
1 parent b40348c commit 44adc7d

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

app/src/main/java/com/surcumference/fingerprint/util/ViewUtils.java

+12-7
Original file line numberDiff line numberDiff line change
@@ -602,14 +602,19 @@ public static void setAlpha(AlertDialog dialog, float value) {
602602
}
603603

604604
public static void setDimAmount(AlertDialog dialog, float value) {
605-
if (dialog == null) {
606-
return;
607-
}
608-
Window window = dialog.getWindow();
609-
if (window == null) {
610-
return;
605+
try {
606+
if (dialog == null) {
607+
return;
608+
}
609+
Window window = dialog.getWindow();
610+
if (window == null) {
611+
return;
612+
}
613+
window.setDimAmount(value);
614+
} catch (Exception e) {
615+
// java.lang.IllegalArgumentException: View=DecorView@2d8132f[PayPwdDialogActivity] not attached to window manager
616+
L.e(e);
611617
}
612-
window.setDimAmount(value);
613618
}
614619

615620
public static View.OnClickListener getOnClickListener(View v) {

0 commit comments

Comments
 (0)