From 4e40d8a4b94dcd7aada1fc6dc276d2d18d5b716f Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 4 Dec 2024 19:21:06 +0100 Subject: [PATCH] Add toast when service connection cannot be established (closes #1757) This is just an example app that should give an example of a happy path. It shouldn't require handle all the errors... --- .../src/main/java/de/blinkt/openvpn/remote/MainFragment.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/remoteExample/src/main/java/de/blinkt/openvpn/remote/MainFragment.java b/remoteExample/src/main/java/de/blinkt/openvpn/remote/MainFragment.java index 14fa38874..d98fdedd8 100644 --- a/remoteExample/src/main/java/de/blinkt/openvpn/remote/MainFragment.java +++ b/remoteExample/src/main/java/de/blinkt/openvpn/remote/MainFragment.java @@ -233,6 +233,10 @@ public void onStop() { @Override public void onClick(View v) { + if (mService == null) { + Toast.makeText(getActivity(), "No service connection to OpenVPN for Android. App not installed?", Toast.LENGTH_LONG).show(); + return; + } switch (v.getId()) { case R.id.startVPN: try {