Add toast instead of crash if no email app installed.

This commit is contained in:
Alex Hart
2020-03-06 10:34:00 -04:00
committed by Greyson Parrelli
parent bf5331ba6e
commit 79fc33630b
4 changed files with 7 additions and 15 deletions

View File

@@ -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() {