From 02c7ebe1aaad7014e2b1de1695c96b56224b35d6 Mon Sep 17 00:00:00 2001 From: Jonas Mayer Date: Tue, 2 Apr 2024 10:48:24 +0200 Subject: [PATCH 1/2] Fix by Alper Signed-off-by: Jonas Mayer --- .../android/ui/activity/FileActivity.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java index 765bd39b29ca..1b43d94639f7 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java @@ -520,17 +520,20 @@ protected void updateFileFromDB(){ * Show loading dialog */ public void showLoadingDialog(String message) { - // grant that only one waiting dialog is shown - dismissLoadingDialog(); - // Construct dialog - Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG); - if (frag == null) { - Log_OC.d(TAG, "show loading dialog"); - LoadingDialog loading = LoadingDialog.newInstance(message); - FragmentManager fm = getSupportFragmentManager(); - FragmentTransaction ft = fm.beginTransaction(); - loading.show(ft, DIALOG_WAIT_TAG); - fm.executePendingTransactions(); + + if (mResumed) { + // grant that only one waiting dialog is shown + dismissLoadingDialog(); + // Construct dialog + Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG); + if (frag == null) { + Log_OC.d(TAG, "show loading dialog"); + LoadingDialog loading = LoadingDialog.newInstance(message); + FragmentManager fm = getSupportFragmentManager(); + FragmentTransaction ft = fm.beginTransaction(); + loading.show(ft, DIALOG_WAIT_TAG); + fm.executePendingTransactions(); + } } } From fe47473e9d635a883517f5109bad66dfb6d02384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alper=20=C3=96zt=C3=BCrk?= <67455295+alperozturk96@users.noreply.github.com> Date: Fri, 24 May 2024 12:19:19 +0200 Subject: [PATCH 2/2] Update app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tom <70907959+ZetaTom@users.noreply.github.com> Signed-off-by: Alper Öztürk <67455295+alperozturk96@users.noreply.github.com> --- .../java/com/owncloud/android/ui/activity/FileActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java index 1b43d94639f7..c598db8f317a 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java @@ -531,8 +531,8 @@ public void showLoadingDialog(String message) { LoadingDialog loading = LoadingDialog.newInstance(message); FragmentManager fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); - loading.show(ft, DIALOG_WAIT_TAG); - fm.executePendingTransactions(); + ft.add(loading, DIALOG_WAIT_TAG); + ft.commitAllowingStateLoss(); } } }