mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 08:39:22 +01:00
Add toast instead of crash if no email app installed.
This commit is contained in:
committed by
Greyson Parrelli
parent
bf5331ba6e
commit
79fc33630b
@@ -1,7 +1,6 @@
|
||||
package org.thoughtcrime.securesms.help;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.pm.LabeledIntent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@@ -157,7 +156,11 @@ public class HelpFragment extends Fragment {
|
||||
intent.putExtra(Intent.EXTRA_SUBJECT, getEmailSubject());
|
||||
intent.putExtra(Intent.EXTRA_TEXT, body.toString());
|
||||
|
||||
startActivity(intent);
|
||||
if (IntentUtils.isResolvable(requireContext(), intent)) {
|
||||
startActivity(intent);
|
||||
} else {
|
||||
Toast.makeText(requireContext(), R.string.HelpFragment__no_email_app_found, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
private String getEmailSubject() {
|
||||
|
||||
Reference in New Issue
Block a user