Skip to content

Commit

Permalink
Merge pull request #13105 from nextcloud/backport/13037/stable-3.29
Browse files Browse the repository at this point in the history
[stable-3.29] Fix Crash Show Fragment During FileActivity Lifecycle Change
  • Loading branch information
AndyScherzinger authored Jun 13, 2024
2 parents 61e8239 + fdd3670 commit 40570ee
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -520,17 +520,16 @@ 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();
ft.add(loading, DIALOG_WAIT_TAG);
ft.commitAllowingStateLoss();
}
}

Expand Down

0 comments on commit 40570ee

Please sign in to comment.