]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
Eliminate loading of some duplicate tabs on restart. https://redmine.stoutner.com...
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / activities / MainWebViewActivity.java
index 600db329efa991a46e11f99b35ed3bacbb59abea..78629e559f4b2a4c487097ef91f6eebabd24d042 100644 (file)
@@ -4757,6 +4757,9 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
             // Get the intent that started the app.
             Intent intent = getIntent();
 
+            // Reset the intent.  This prevents a duplicate tab from being created on restart.
+            setIntent(new Intent());
+
             // Get the information from the intent.
             String intentAction = intent.getAction();
             Uri intentUriData = intent.getData();
@@ -5411,7 +5414,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
             }
 
             // Get the file name from the content disposition.
-            String fileNameString = PrepareSaveDialog.getFileNameFromContentDisposition(this, contentDisposition, downloadUrl);
+            String fileNameString = PrepareSaveDialog.getFileNameFromHeaders(this, contentDisposition, mimetype, downloadUrl);
 
             // Instantiate the save dialog.
             DialogFragment saveDialogFragment = SaveWebpageDialog.saveWebpage(StoragePermissionDialog.SAVE_URL, downloadUrl, formattedFileSizeString, fileNameString, userAgent,
@@ -6452,6 +6455,9 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
             // Get the intent that started the app.
             Intent launchingIntent = getIntent();
 
+            // Reset the intent.  This prevents a duplicate tab from being created on restart.
+            setIntent(new Intent());
+
             // Get the information from the intent.
             String launchingIntentAction = launchingIntent.getAction();
             Uri launchingIntentUriData = launchingIntent.getData();