diff options
author | Alex Ning <chineseperson5@gmail.com> | 2020-11-12 04:18:30 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2020-11-12 04:18:30 +0000 |
commit | 330b2732fd917a56badb96f6307c311a8e4661bb (patch) | |
tree | fa44fbb7537ea30319dc1a7acab1d6285d93b211 | |
parent | 95a9215ec8159c01bada1d07bb7b647372016b80 (diff) | |
download | infinity-for-reddit-330b2732fd917a56badb96f6307c311a8e4661bb.tar infinity-for-reddit-330b2732fd917a56badb96f6307c311a8e4661bb.tar.gz infinity-for-reddit-330b2732fd917a56badb96f6307c311a8e4661bb.tar.bz2 infinity-for-reddit-330b2732fd917a56badb96f6307c311a8e4661bb.tar.lz infinity-for-reddit-330b2732fd917a56badb96f6307c311a8e4661bb.tar.xz infinity-for-reddit-330b2732fd917a56badb96f6307c311a8e4661bb.tar.zst infinity-for-reddit-330b2732fd917a56badb96f6307c311a8e4661bb.zip |
Fix email client not found.
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AboutPreferenceFragment.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AboutPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AboutPreferenceFragment.java index 71e9dbc6..640c8398 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AboutPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AboutPreferenceFragment.java @@ -2,6 +2,7 @@ package ml.docilealligator.infinityforreddit.Settings; import android.app.Activity; +import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.net.Uri; @@ -74,9 +75,9 @@ public class AboutPreferenceFragment extends PreferenceFragmentCompat { emailPreference.setOnPreferenceClickListener(preference -> { Intent intent = new Intent(Intent.ACTION_SENDTO); intent.setData(Uri.parse("mailto:docilealligator.app@gmail.com")); - if (intent.resolveActivity(activity.getPackageManager()) != null) { + try { startActivity(intent); - } else { + } catch (ActivityNotFoundException e) { Toast.makeText(activity, R.string.no_email_client, Toast.LENGTH_SHORT).show(); } return true; |