diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2018-06-30 20:45:42 +0530 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-06-30 21:10:22 +0200 |
commit | 5c9643a23b3dab7c37289030532ff1f27032ba84 (patch) | |
tree | ee9e3dc07249d94077d8c46d7838c6dc9c8c3fe4 | |
parent | 0e3e3ae37b093c8de04be2a141e7b49d708f5336 (diff) |
android: VersionPreference: Handle no-browser-installed case
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
-rw-r--r-- | app/src/main/java/com/wireguard/android/preference/VersionPreference.java | 5 |
1 files changed, 4 insertions, 1 deletions
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) { } } } |