diff options
Diffstat (limited to 'src/de/blinkt/openvpn/Settings_Basic.java')
-rw-r--r-- | src/de/blinkt/openvpn/Settings_Basic.java | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/de/blinkt/openvpn/Settings_Basic.java b/src/de/blinkt/openvpn/Settings_Basic.java index 3234d0df..3eb484cb 100644 --- a/src/de/blinkt/openvpn/Settings_Basic.java +++ b/src/de/blinkt/openvpn/Settings_Basic.java @@ -93,9 +93,9 @@ public class Settings_Basic extends Fragment implements View.OnClickListener, On public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); String profileuuid =getArguments().getString(getActivity().getPackageName() + ".profileUUID"); mProfile=ProfileManager.get(profileuuid); - super.onCreate(savedInstanceState); } @Override @@ -129,8 +129,7 @@ public class Settings_Basic extends Fragment implements View.OnClickListener, On addFileSelectLayout(mpkcs12); mpkcs12.setNoline(); - loadPreferences(); - + mType.setOnItemSelectedListener(this); mView.findViewById(R.id.select_keystore_button).setOnClickListener(this); @@ -143,6 +142,15 @@ public class Settings_Basic extends Fragment implements View.OnClickListener, On return mView; } + + @Override + public void onStart() { + super.onStart(); + String profileuuid =getArguments().getString(getActivity().getPackageName() + ".profileUUID"); + mProfile=ProfileManager.get(profileuuid); + loadPreferences(); + + } @Override public void onActivityResult(int request, int result, Intent data) { @@ -158,7 +166,6 @@ public class Settings_Basic extends Fragment implements View.OnClickListener, On @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - ((VPNPreferences) getActivity()).setmBS(this); } @Override @@ -167,6 +174,11 @@ public class Settings_Basic extends Fragment implements View.OnClickListener, On changeType(position); } } + @Override + public void onPause() { + super.onPause(); + savePreferences(); + } @@ -298,7 +310,9 @@ public class Settings_Basic extends Fragment implements View.OnClickListener, On public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); savePreferences(); - outState.putString(getActivity().getPackageName() + "profileUUID", mProfile.getUUID().toString()); + if(mProfile!=null) { + outState.putString(getActivity().getPackageName() + "profileUUID", mProfile.getUUID().toString()); + } } @Override |