summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2020-07-25 11:21:02 +0200
committercyBerta <cyberta@riseup.net>2020-07-25 11:21:02 +0200
commit324775ffad121f708e8f1d707c317db34f209c78 (patch)
treef5c361f253988cbf21fccb19a30af6bb03557ab4
parent86a2a765b9b7bea005bafaad5a4489f06a151de3 (diff)
register and unregister providerAPIBroadcastReceiver in onCreate/onDestroy in order to fix #8990
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/ProviderSetupBaseActivity.java13
1 files 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();
@@ -86,15 +86,12 @@ 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;
}