mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-02 14:27:10 +01:00
Fix email client not found.
This commit is contained in:
parent
95a9215ec8
commit
330b2732fd
@ -2,6 +2,7 @@ package ml.docilealligator.infinityforreddit.Settings;
|
|||||||
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@ -74,9 +75,9 @@ public class AboutPreferenceFragment extends PreferenceFragmentCompat {
|
|||||||
emailPreference.setOnPreferenceClickListener(preference -> {
|
emailPreference.setOnPreferenceClickListener(preference -> {
|
||||||
Intent intent = new Intent(Intent.ACTION_SENDTO);
|
Intent intent = new Intent(Intent.ACTION_SENDTO);
|
||||||
intent.setData(Uri.parse("mailto:docilealligator.app@gmail.com"));
|
intent.setData(Uri.parse("mailto:docilealligator.app@gmail.com"));
|
||||||
if (intent.resolveActivity(activity.getPackageManager()) != null) {
|
try {
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
} else {
|
} catch (ActivityNotFoundException e) {
|
||||||
Toast.makeText(activity, R.string.no_email_client, Toast.LENGTH_SHORT).show();
|
Toast.makeText(activity, R.string.no_email_client, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user