From 32c96eb54ccb08efdffc0231f6216e7b688a168d Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Wed, 22 Mar 2017 16:57:51 -0700 Subject: [PATCH] Apply domain settings after closing `DomainActivity` or `SettingsActivity`. Implements https://redmine.stoutner.com/issues/109. --- .../privacybrowser/activities/MainWebViewActivity.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 2.45.2