From: Soren Stoutner Date: Wed, 22 Mar 2017 23:57:51 +0000 (-0700) Subject: Apply domain settings after closing `DomainActivity` or `SettingsActivity`. Implemen... X-Git-Tag: v2.1~8 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=32c96eb54ccb08efdffc0231f6216e7b688a168d;p=PrivacyBrowserAndroid.git Apply domain settings after closing `DomainActivity` or `SettingsActivity`. Implements https://redmine.stoutner.com/issues/109. --- diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index e3c85f57..1ec9e746 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -209,7 +209,7 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation // `proxyThroughOrbot` is used in `onCreate()` and `applySettings()` private boolean proxyThroughOrbot; - // `currentDomain` is used in `onCreate() and `applyDomainSettings()`. + // `currentDomain` is used in `onCreate(), `onNavigationItemSelected()`, and `applyDomainSettings()`. private String currentDomain; // `pendingUrl` is used in `onCreate()` and `applySettings()` @@ -1271,12 +1271,18 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation break; case R.id.settings: + // Reset `currentDomain` so that domain settings are reapplied after returning to `MainWebViewActivity`. + currentDomain = ""; + // Launch `SettingsActivity`. Intent settingsIntent = new Intent(this, SettingsActivity.class); startActivity(settingsIntent); break; case R.id.domains: + // Reset `currentDomain` so that domain settings are reapplied after returning to `MainWebViewActivity`. + currentDomain = ""; + // Launch `DomainsActivity`. Intent domainsIntent = new Intent(this, DomainsActivity.class); startActivity(domainsIntent);