]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
Add a preference to control opening of intents in new tabs. https://redmine.stoutner...
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / activities / MainWebViewActivity.java
index e3adab232ba16b4d74a0b2cf9030ae8b3c0836e1..ed0259f21c2805179ec03f36b85c41e19d86e89c 100644 (file)
@@ -812,8 +812,13 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
             // Sets the new intent as the activity intent, which replaces the one that originally started the app.
             setIntent(intent);
 
-            // Add a new tab.
-            addTab(null);
+            // Get the shared preferences.
+            SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
+
+            if (sharedPreferences.getBoolean("open_intents_in_new_tab", true)) {
+                // Add a new tab.
+                addTab(null);
+            }
 
             // Create a URL string.
             String url;
@@ -1075,7 +1080,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
         // Only show Ad Consent if this is the free flavor.
         adConsentMenuItem.setVisible(BuildConfig.FLAVOR.contentEquals("free"));
 
-        // Get the shared preference values.
+        // Get the shared preferences.
         SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
 
         // Get the dark theme and app bar preferences..