diff options
author | Arne Schwabe <arne@rfc2549.org> | 2016-07-04 17:57:44 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2016-07-04 17:57:44 +0200 |
commit | f0d2595b794bc02d4527cf37c312d7dacd86b7bc (patch) | |
tree | 99ab739c911dfabb3f804d9eff3d3b00100a8a81 /main/src | |
parent | a3bf88b09e5e686f07efb305efedf71a13faf15c (diff) |
Fix Config fragment not always showing the most current config
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/fragments/ShowConfigFragment.java | 22 |
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(); + } } |