From 5c9643a23b3dab7c37289030532ff1f27032ba84 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 30 Jun 2018 20:45:42 +0530 Subject: android: VersionPreference: Handle no-browser-installed case Signed-off-by: Harsh Shandilya --- .../java/com/wireguard/android/preference/VersionPreference.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/com/wireguard') diff --git a/app/src/main/java/com/wireguard/android/preference/VersionPreference.java b/app/src/main/java/com/wireguard/android/preference/VersionPreference.java index 2ed12d63..19c1b719 100644 --- a/app/src/main/java/com/wireguard/android/preference/VersionPreference.java +++ b/app/src/main/java/com/wireguard/android/preference/VersionPreference.java @@ -5,6 +5,7 @@ package com.wireguard.android.preference; +import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.net.Uri; @@ -46,7 +47,9 @@ public class VersionPreference extends Preference { protected void onClick() { final Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("https://www.wireguard.com/")); - getContext().startActivity(intent); + try { + getContext().startActivity(intent); + } catch (final ActivityNotFoundException ignored) { } } } -- cgit v1.2.3