From d6d3bba6f0c070d151835f33ec2ec71a40f8a209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Zolnai?= Date: Tue, 12 Sep 2017 12:51:49 +0200 Subject: Fix rare crash with LogFragment --- main/src/main/java/de/blinkt/openvpn/fragments/LogFragment.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/LogFragment.java b/main/src/main/java/de/blinkt/openvpn/fragments/LogFragment.java index 30f922ae..e64ce2cd 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/LogFragment.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/LogFragment.java @@ -503,13 +503,16 @@ public class LogFragment extends ListFragment implements StateListener, SeekBar. @Override public void onResume() { super.onResume(); - VpnStatus.addStateListener(this); - VpnStatus.addByteCountListener(this); Intent intent = new Intent(getActivity(), OpenVPNService.class); intent.setAction(OpenVPNService.START_SERVICE); - } + @Override + public void onStart() { + super.onStart(); + VpnStatus.addStateListener(this); + VpnStatus.addByteCountListener(this); + } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { -- cgit v1.2.3