summaryrefslogtreecommitdiff
path: root/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
index 3fd08553..49ae56bb 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
@@ -320,17 +320,17 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
// Check if running on a TV
if (runningOnAndroidTV() && !(priority < 0))
- guiHandler.post(new Runnable() {
-
- @Override
- public void run() {
-
- if (mlastToast != null)
- mlastToast.cancel();
- String toastText = String.format(Locale.getDefault(), "%s - %s", mProfile.mName, msg);
- mlastToast = Toast.makeText(getBaseContext(), toastText, Toast.LENGTH_SHORT);
- mlastToast.show();
- }
+ guiHandler.post(() -> {
+ if (mlastToast != null)
+ mlastToast.cancel();
+ String name;
+ if (mProfile != null)
+ name = mProfile.mName;
+ else
+ name = "OpenVPN";
+ String toastText = String.format(Locale.getDefault(), "%s - %s", name, msg);
+ mlastToast = Toast.makeText(getBaseContext(), toastText, Toast.LENGTH_SHORT);
+ mlastToast.show();
});
}