diff options
-rw-r--r-- | ui/src/main/java/com/wireguard/android/preference/DonatePreference.kt | 5 | ||||
-rw-r--r-- | ui/src/main/java/com/wireguard/android/preference/VersionPreference.kt | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/ui/src/main/java/com/wireguard/android/preference/DonatePreference.kt b/ui/src/main/java/com/wireguard/android/preference/DonatePreference.kt index 57202c81..8a9916a9 100644 --- a/ui/src/main/java/com/wireguard/android/preference/DonatePreference.kt +++ b/ui/src/main/java/com/wireguard/android/preference/DonatePreference.kt @@ -6,11 +6,11 @@ package com.wireguard.android.preference import android.app.AlertDialog -import android.content.ActivityNotFoundException import android.content.Context import android.content.Intent import android.net.Uri import android.util.AttributeSet +import android.widget.Toast import androidx.preference.Preference import com.wireguard.android.BuildConfig import com.wireguard.android.R @@ -32,7 +32,8 @@ class DonatePreference(context: Context, attrs: AttributeSet?) : Preference(cont intent.data = Uri.parse("https://www.wireguard.com/donations/") try { context.startActivity(intent) - } catch (ignored: ActivityNotFoundException) { + } catch (e: Throwable) { + Toast.makeText(context, e.localizedMessage, Toast.LENGTH_SHORT).show() } } }
\ No newline at end of file diff --git a/ui/src/main/java/com/wireguard/android/preference/VersionPreference.kt b/ui/src/main/java/com/wireguard/android/preference/VersionPreference.kt index 31c751d2..9993936a 100644 --- a/ui/src/main/java/com/wireguard/android/preference/VersionPreference.kt +++ b/ui/src/main/java/com/wireguard/android/preference/VersionPreference.kt @@ -4,11 +4,11 @@ */ package com.wireguard.android.preference -import android.content.ActivityNotFoundException import android.content.Context import android.content.Intent import android.net.Uri import android.util.AttributeSet +import android.widget.Toast import androidx.preference.Preference import com.wireguard.android.Application import com.wireguard.android.BuildConfig @@ -33,7 +33,8 @@ class VersionPreference(context: Context, attrs: AttributeSet?) : Preference(con intent.data = Uri.parse("https://www.wireguard.com/") try { context.startActivity(intent) - } catch (_: ActivityNotFoundException) { + } catch (e: Throwable) { + Toast.makeText(context, e.localizedMessage, Toast.LENGTH_SHORT).show() } } |