From eb93e2bb7e56daeac6a65aa596cfdd9261a9b426 Mon Sep 17 00:00:00 2001 From: adbenitez Date: Thu, 19 Dec 2024 16:39:52 +0100 Subject: [PATCH] add comment --- .../java/org/thoughtcrime/securesms/WebxdcActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/thoughtcrime/securesms/WebxdcActivity.java b/src/main/java/org/thoughtcrime/securesms/WebxdcActivity.java index 7211dc525..703bdbeaf 100644 --- a/src/main/java/org/thoughtcrime/securesms/WebxdcActivity.java +++ b/src/main/java/org/thoughtcrime/securesms/WebxdcActivity.java @@ -237,7 +237,11 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE long timeDelta = System.currentTimeMillis() - lastOpenTime; final String url = this.baseURL + "/webxdc_bootstrap324567869.html?i=" + (internetAccess? "1" : "0") + "&href=" + encodedHref; Util.runOnAnyBackgroundThread(() -> { - if (timeDelta < 2000) {Util.sleep(1000);} + if (timeDelta < 2000) { + // this is to avoid getting stuck in the FILL500 in some devices if the + // previous webview was not destroyed yet and a new app is opened too soon + Util.sleep(1000); + } Util.runOnMain(() -> webView.loadUrl(url)); });