From 324775ffad121f708e8f1d707c317db34f209c78 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sat, 25 Jul 2020 11:21:02 +0200 Subject: register and unregister providerAPIBroadcastReceiver in onCreate/onDestroy in order to fix #8990 --- .../se/leap/bitmaskclient/ProviderSetupBaseActivity.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/se/leap/bitmaskclient/ProviderSetupBaseActivity.java b/app/src/main/java/se/leap/bitmaskclient/ProviderSetupBaseActivity.java index 89944364..9c28800a 100644 --- a/app/src/main/java/se/leap/bitmaskclient/ProviderSetupBaseActivity.java +++ b/app/src/main/java/se/leap/bitmaskclient/ProviderSetupBaseActivity.java @@ -65,13 +65,13 @@ public abstract class ProviderSetupBaseActivity extends ConfigWizardBaseActivity super.onCreate(savedInstanceState); fragmentManager = new FragmentManagerEnhanced(getSupportFragmentManager()); providerManager = ProviderManager.getInstance(getAssets(), getExternalFilesDir(null)); + setUpProviderAPIResultReceiver(); } @Override protected void onResume() { super.onResume(); Log.d(TAG, "resuming with ConfigState: " + providerConfigState.toString()); - setUpProviderAPIResultReceiver(); if (SETTING_UP_PROVIDER == providerConfigState) { showProgressBar(); checkProviderSetUp(); @@ -85,16 +85,13 @@ public abstract class ProviderSetupBaseActivity extends ConfigWizardBaseActivity } } - @Override - protected void onPause() { - super.onPause(); - if (providerAPIBroadcastReceiver != null) - LocalBroadcastManager.getInstance(this).unregisterReceiver(providerAPIBroadcastReceiver); - } - @Override protected void onDestroy() { super.onDestroy(); + if (providerAPIBroadcastReceiver != null) { + LocalBroadcastManager.getInstance(this).unregisterReceiver(providerAPIBroadcastReceiver); + } + providerAPIBroadcastReceiver = null; } -- cgit v1.2.3