summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/src/main/java/de/blinkt/openvpn/fragments/ShowConfigFragment.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/ShowConfigFragment.java b/main/src/main/java/de/blinkt/openvpn/fragments/ShowConfigFragment.java
index bc763a9d..c3a3196d 100644
--- a/main/src/main/java/de/blinkt/openvpn/fragments/ShowConfigFragment.java
+++ b/main/src/main/java/de/blinkt/openvpn/fragments/ShowConfigFragment.java
@@ -102,11 +102,15 @@ public class ShowConfigFragment extends Fragment {
public void onResume() {
super.onResume();
- String profileUUID = getArguments().getString(getActivity().getPackageName() + ".profileUUID");
- final VpnProfile vp = ProfileManager.get(getActivity(),profileUUID);
- int check=vp.checkProfile(getActivity());
+ populateConfigText();
+ }
+
+ private void populateConfigText() {
+ String profileUUID = getArguments().getString(getActivity().getPackageName() + ".profileUUID");
+ final VpnProfile vp = ProfileManager.get(getActivity(),profileUUID);
+ int check=vp.checkProfile(getActivity());
- if(check!=R.string.no_error_found) {
+ if(check!= R.string.no_error_found) {
mConfigView.setText(check);
configtext = getString(check);
}
@@ -116,5 +120,13 @@ public class ShowConfigFragment extends Fragment {
mConfigView.setText("Generating config...");
startGenConfig(vp, mConfigView);
}
- }
+ }
+
+ @Override
+ public void setUserVisibleHint(boolean visible)
+ {
+ super.setUserVisibleHint(visible);
+ if (visible && isResumed())
+ populateConfigText();
+ }
}