Browse Source

Avoid overlapping an existing dialog

Juan Carlos González Cabrero 9 năm trước cách đây
mục cha
commit
47560ea7d5

+ 7 - 4
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -1728,11 +1728,14 @@ public class FileDisplayActivity extends HookActivity implements
      */
     public void showUntrustedCertDialog(RemoteOperationResult result) {
         // Show a dialog with the certificate info
-        SslUntrustedCertDialog dialog = SslUntrustedCertDialog.newInstanceForFullSslError(
-                (CertificateCombinedException) result.getException());
         FragmentManager fm = getSupportFragmentManager();
-        FragmentTransaction ft = fm.beginTransaction();
-        dialog.show(ft, DIALOG_UNTRUSTED_CERT);
+        SslUntrustedCertDialog dialog = (SslUntrustedCertDialog) fm.findFragmentByTag(DIALOG_UNTRUSTED_CERT);
+        if(dialog == null) {
+            dialog = SslUntrustedCertDialog.newInstanceForFullSslError(
+                (CertificateCombinedException) result.getException());
+            FragmentTransaction ft = fm.beginTransaction();
+            dialog.show(ft, DIALOG_UNTRUSTED_CERT);
+        }
     }
 
     private void requestForDownload(OCFile file) {