summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2021-10-16 02:55:24 +0200
committerArne Schwabe <arne@rfc2549.org>2021-10-16 02:55:24 +0200
commite0b23dfaedf15d2ab7753189c02c3cb29748a644 (patch)
treeadcb2943adf4449dc0a59e855336c0a0157bda30 /main
parenta505a2fa53d26152977a0824aa8f9585adc89aa2 (diff)
Fix crash when switching between night and day mode
Diffstat (limited to 'main')
-rw-r--r--main/src/ui/java/de/blinkt/openvpn/fragments/OpenVpnPreferencesFragment.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/OpenVpnPreferencesFragment.java b/main/src/ui/java/de/blinkt/openvpn/fragments/OpenVpnPreferencesFragment.java
index 212c5e71..8bbc14b0 100644
--- a/main/src/ui/java/de/blinkt/openvpn/fragments/OpenVpnPreferencesFragment.java
+++ b/main/src/ui/java/de/blinkt/openvpn/fragments/OpenVpnPreferencesFragment.java
@@ -6,7 +6,10 @@
package de.blinkt.openvpn.fragments;
import android.os.Bundle;
+import android.view.View;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.preference.PreferenceFragmentCompat;
import de.blinkt.openvpn.R;
@@ -37,12 +40,13 @@ public abstract class OpenVpnPreferencesFragment extends PreferenceFragmentCompa
}
@Override
- public void onActivityCreated(Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
- if(savedInstanceState!=null) {
- String profileUUID=savedInstanceState.getString(VpnProfile.EXTRA_PROFILEUUID);
- mProfile = ProfileManager.get(getActivity(),profileUUID);
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ if (savedInstanceState != null) {
+ String profileUUID = savedInstanceState.getString(VpnProfile.EXTRA_PROFILEUUID);
+ mProfile = ProfileManager.get(getActivity(), profileUUID);
loadSettings();
+
}
}