From 77929094851d5b5c46c3ff37b227a3b7994797ab Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 4 Dec 2024 19:21:06 +0100 Subject: 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... Signed-off-by: Arne Schwabe --- .../src/main/java/de/blinkt/openvpn/remote/MainFragment.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'remoteExample/src/main/java') 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 14fa3887..d98fdedd 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 class MainFragment extends Fragment implements View.OnClickListener, Hand @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 { -- cgit v1.2.3