From fb38b7b60b888cc9a4caed5ce0a271b1f7d487ea Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 19 May 2022 16:28:05 +0200 Subject: add providerObservable as member variable to EipFragment, ensure the Fragment has always the latest provider object --- .../main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/src/main') 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(); } -- cgit v1.2.3