summaryrefslogtreecommitdiff
path: root/app/src/main/java/se
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-05-19 16:28:05 +0200
committercyBerta <cyberta@riseup.net>2022-05-19 16:28:05 +0200
commitfb38b7b60b888cc9a4caed5ce0a271b1f7d487ea (patch)
treee76281c7fbe19ca73e1fb75e40d4da13e4a40c33 /app/src/main/java/se
parent7923e2bf9de7cec0a7cd2e428655a93c33f7c5aa (diff)
add providerObservable as member variable to EipFragment, ensure the Fragment has always the latest provider object
Diffstat (limited to 'app/src/main/java/se')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java
index c777e727..deac214d 100644
--- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java
+++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java
@@ -123,6 +123,7 @@ public class EipFragment extends Fragment implements Observer {
private Unbinder unbinder;
private EipStatus eipStatus;
+ private ProviderObservable providerObservable;
private TorStatusObservable torStatusObservable;
private GatewaysManager gatewaysManager;
@@ -173,6 +174,7 @@ public class EipFragment extends Fragment implements Observer {
super.onCreate(savedInstanceState);
openVpnConnection = new EipFragmentServiceConnection();
eipStatus = EipStatus.getInstance();
+ providerObservable = ProviderObservable.getInstance();
torStatusObservable = TorStatusObservable.getInstance();
Activity activity = getActivity();
if (activity != null) {
@@ -190,6 +192,7 @@ public class EipFragment extends Fragment implements Observer {
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
eipStatus.addObserver(this);
torStatusObservable.addObserver(this);
+ providerObservable.addObserver(this);
View view = inflater.inflate(R.layout.f_eip, container, false);
unbinder = ButterKnife.bind(this, view);
@@ -267,6 +270,7 @@ public class EipFragment extends Fragment implements Observer {
public void onDestroyView() {
super.onDestroyView();
eipStatus.deleteObserver(this);
+ providerObservable.deleteObserver(this);
torStatusObservable.deleteObserver(this);
unbinder.unbind();
}